Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
tcn-mvb-acp_ms_en_118
TCN-MVB-ACP
ACP protocol description
Programmer’s manual
Version 1.18
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 2/71
AMiT spol. s r. o. does not provide any warranty concerning the contents of this publication and reserves the right to change the documentation without obligation to inform any body or authority about it.
This document can be copied and redistributed under following conditions:
1. The whole text (all pages) must be copied without any changes. 2. All redistributed copies must retain the AMiT, spol. s r. o. copyright notice
and any other notices contained in the documentation. 3. This document may not be distributed for purpose making of profit. The names of products and companies used herein can be trademarks or registered trademarks of their respective owners.
AMiT is a registered trademark.
Copyright (c) 2016, AMiT, spol. s r. o.
Producer: AMiT, spol. s r. o. Naskové 1100/3, 150 00 Praha www.amit-transportation.com
Technical support: [email protected]
TCN-MVB-ACP
3/71 tcn-mvb-acp_ms_en_118
Contents
History of revisions ......................................................................................... 5 Related documentation ................................................................................... 5
1. Introduction .......................................................................................... 6
2. HW solution .......................................................................................... 7
2.1. System block scheme ..................................................................................... 7 2.2. Interface to 407 processor .............................................................................. 7 2.3. Interface to host system ................................................................................. 7
3. SW solution .......................................................................................... 8
3.1. Description of MVB module access protocol .................................................. 8
3.2. Description of services ................................................................................. 10 3.2.1 Writing the configuration service................................................................... 10
3.2.2 Reading the configuration service ................................................................ 12 3.2.3 Writing the configuration extended service ................................................... 13 3.2.4 Reading the configuration extended service ................................................. 14 3.2.5 Writing the device status service .................................................................. 14
3.2.6 Reading the device status service ................................................................ 15 3.2.7 Reading the list of found devices service ..................................................... 16
3.2.8 Reading the MVB statistics service .............................................................. 17 3.2.9 Clearing the MVB statistics service .............................................................. 18 3.2.10 Writing the ports configuration service .......................................................... 18
3.2.11 Reading the ports configuration service ....................................................... 20 3.2.12 Writing data to the port service ..................................................................... 21
3.2.13 Reading data from the port service ............................................................... 22 3.2.14 Writing data to set of ports service ............................................................... 23
3.2.15 Reading data from set of ports service ......................................................... 23 3.2.16 Enabling the port service .............................................................................. 24 3.2.17 Disabling the port service ............................................................................. 25
3.2.18 Enabling set of ports service ........................................................................ 26
3.2.19 Disabling set of ports service ........................................................................ 26 3.2.20 Forcing data to the port service .................................................................... 27 3.2.21 Unforcing data from the port service ............................................................. 28 3.2.22 Unforcing all data from traffic store service .................................................. 28 3.2.23 Writing the ACP/ANM control ....................................................................... 29
3.2.24 Reading the ACP/ANM status service .......................................................... 30 3.2.25 Clearing the journal service .......................................................................... 31 3.2.26 Reading the journal service .......................................................................... 32 3.3. Description of services for MD communication (class 2) .............................. 35
AMI result codes ........................................................................................... 35
3.3.1 Reading the station identifier service ............................................................ 37 3.3.2 Writing the station identifier service .............................................................. 37
3.3.3 Reading the routing directories service ........................................................ 38 3.3.4 Writing the routing directories service ........................................................... 40 3.3.5 Reading the TCN messenger status ............................................................. 42 3.3.6 Writing the TCN messenger control .............................................................. 44 3.3.7 Registration of caller and replier functions .................................................... 45 3.3.8 Cancel previous registration of caller and replier functions .......................... 46
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 4/71
3.3.9 Reading states of MD instances ................................................................... 47 3.3.10 Writing control of the caller instance ............................................................. 51
3.3.11 Writing control of the replier instance ........................................................... 54 3.4. Description of services for bus administration (class 3 and 4) ...................... 56 3.4.1 Writing bus administrator configuration service ............................................ 57 3.4.2 Writing cancel bus administrator configuration service ................................. 60
3.4.3 Writing start/stop bus administrator service .................................................. 61 3.4.4 Reading bus administrator status service ..................................................... 62 3.4.5 Reading bus administrator statistics service ................................................. 63 3.4.6 Clearing bus administrator statistics service ................................................. 64 3.5. The Description of services for module firmware updating ........................... 65 3.5.1 Download control .......................................................................................... 66
3.5.2 Download status check ................................................................................. 67 3.5.3 Firmware data download .............................................................................. 69 3.5.4 Get information about device ........................................................................ 69
3.6. Encoding of data types ................................................................................. 71
TCN-MVB-ACP
5/71 tcn-mvb-acp_ms_en_118
History of revisions
Document name: tcn-mvb-acp_ms_en_118.pdf
Version Date Author of change Changes
100 27. 11. 2012 Maštálka O. New document.
101 14. 01. 2013 Maštálka O. Correct result codes, add enabling set of ports and disabling set of ports services.
102 29. 01. 2013 Maštálka O. Add reading the list of found devices service
103 18. 02. 2013 Maštálka O. Add fields HW and SW name into Reading the configuration service. Add reading the MVB statistics service. Add clearing the MVB statistics service. Correct encoding of data types.
104 13. 03. 2013 Maštálka O. Add field T_reply into Writing the configuration service. Add fields Frame_cnt, Frame_err_cnt, Frame_err_a_cnt, Frame_err_b_cnt and Switch_cnt to Reading the MVB statistics service.
105 17. 06. 2013 Maštálka O. Updated chapter 3.3.
106 27. 09. 2013 Maštálka O. Add MD and journal services.
107 22. 11. 2013 Maštálka O. Add state machine description in MD services.
108 07. 02. 2014 Maštálka O. Add bus administrator services.
109 21. 03. 2014 Maštálka O. Add examples of using some services.
110 12. 05. 2014 Maštálka O. Chapter 3.1. – correct sequential number description.
111 14. 07. 2014 Maštálka O. Document revision.
112 09. 09. 2014 Maštálka O. Add particular counting of ACP frame length in all services.
113 25. 09. 2014 Maštálka O. Correct description of writing control of the replier instance.
114 03. 03. 2015 Maštálka O. Correct bus administrator services (chapter 3.4.), added a get information about device configuration frame (chapter 3.5.4).
115 06. 05. 2015 Dočekal A. Chapter 3.5.4, DEV_STATUS updated, information about invalid device runtime status added.
116 22. 06. 2015 Maštálka O. Chapter 3.4.1, add service load of list of devices for MD communication. Chapter 3.4.5, add counters to bus administrator statistics.
117 10. 11. 2015 Maštálka O. Chapter 3.1., add example of data stuffing and framing. Chapter 3.3.6, add MICAS system group compatibility.
118 23. 05. 2016 Tomáš M. Add Chapters 3.2.3, 3.2.4.
Related documentation
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 6/71
1. Introduction
Module RM-MVB10/1x is a communication interface between MVB line and customer hardware.
The module mediates the all MVB services. Module software, depending on its type, provides for MVB TCN process data and message services as well as bus administration.
This document describes the module software interface which provides to TCN MVB the process data services. Piggy back technique Built-in into third party equipments Parallel / serial connection to host CPU Possible support of all MVB classes Possible bus administration Possibility of TCN messenger Secured communication protocol with host CPU Simple implementation of protocol in host CPU
TCN-MVB-ACP
7/71 tcn-mvb-acp_ms_en_118
2. HW solution
2.1. System block scheme
pipe UART emulation
Fig. 1 - System block scheme
2.2. Interface to 407 processor
Interface to 407 processor is designed as proprietary pipe over SPI bus. Description of this interface is not subject of this document.
2.3. Interface to host system
Interface to host is realized by UART, choice of which depends on applicator. Variants considered so far takes into account the asynchronous UART interface (RXD, TXD, handshaking), simplified emulated UART over parallel bus and emulated UART 16C550A over LPC bus.
Detail description of these interfaces is beyond the scope of this document.
407 Altera Host
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 8/71
3. SW solution
3.1. Description of MVB module access protocol
Protocol for accessing MVB via UART is frame oriented. The frame is preambled by pair of characters data link escape followed by start of text (DLE STX) and terminated by pair of characters data link escape followed by end of text (DLE ETX). Presence of character DLE as data is realized by its twinning. Codes of control characters was chosen from ASCII table (STX = 0x02, ETX = 0x03, DLE = 0x10). Example of stuffing and framing of data is in the following table: Data to be sent:
A DLE B ETX DLE STX E
After stuffing and framing:
DLE STX A DLE DLE B ETX DLE DLE STX E DLE ETX
Frame is composed from 6-byte header and data. On the frame end is stored the frame checksum, calculated under CRC16-CCITT algorithm. Minimum frame length is 8 bytes, maximum frame length is 508 bytes. Length of initial (DLE STX) preamble and terminating (DLE ETX) delimiter is not included in frame length nor in frame header. Frame is structured as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length incl. header and CRC (minimum 8 bytes)
Request type Ch8 Request (“c”) / response (“r”)
Service Ch8 Service type
Command/Status U8/Ch8 Command/process return code
Sequential number U8 Session sequential number
… … Frame data
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
When a twinning DLE character appears, it is not part of frame (not included in frame length) and must be removed when receiving data.
CRC is calculated from all data, starting with frame length and last data byte before CRC field.
CRC16-CCITT uses a x16 + x12 + x5 + 1 polynomial
Initial CRC value before calculation is equal to 0xFFFF. Protocol is of request/response type, i.e. each service is confirmed. Modification (write) services are coded by upper case letter, reading
services are coded by lower case letter. All frame elements are aligned to multiples of their length and moreover,
each frame is rounded to even number of bytes.
Note:
Note:
TCN-MVB-ACP
9/71 tcn-mvb-acp_ms_en_118
All multi-byte numeric frame components are little endian ordered. Little endian ordering relates only to frame items. Port data (datasets) are
transmitted like byte-stream without endian conversion. It’s up to application to fill the dataset properly, in accordance with data type specification in TCN standard (TCN standard codes all multi-byte numerical types with big endian order).
Sequential number identifies the given session; it’s incremented by modulo 256 for each new outgoing session, correspond response includes a sequential number identical with request.
If processing of data fails, then the reply frame does not contain any data except of return code.
Return codes are as follows:
Return code Value Meaning
amit_mvb_ok 0 All is OK
amit_mvb_failure 1 Unspecified failure
Communication return codes
amit_mvb_res_bad_size 2 Incorrect frame length
amit_mvb_res_send_err 3 Frame sending error
amit_mvb_res_tmo_err 4 Session timeout (while waiting for response)
amit_mvb_rem_canc_err 5 Session cancelled by partner
amit_mvb_rem_not_found 6 Session not found at partner
amit_mvb_rem_no_free 7 No free resources for incoming request at partner
amit_mvb_rem_dupl 8 Previous session was not yet finished
amit_mvb_rem_ usr_unreg 9 User not registered at partner
amit_mvb_rem_int_err 10 Internal error at partner
Application return codes
amit_mvb_rem_no_free 30 No free resources in remote application (instance, memory)
amit_mvb_rem_ srv_unreg 31 Service not registered
amit_mvb_rem_ srv_fail 32 Service not executed
amit_mvb_rem_bad_len 33 Wrong length of received datagram
amit_mvb_rem_bad_pars 34 Incorrect parameters in received datagram
amit_mvb_rem_lp_err 35 LPI/LPA access error
amit_mvb_rem_ls_err 36 Supervision interface error
amit_mvb_rem_port_bad_cfg 37 Incorrect port configuration
amit_mvb_rem_ports_many 38 Too many ports
amit_mvb_rem_sys_no_psv 39 Passive state of system is required
amit_mvb_dwn_err_init 52 Initialization of firmware loading error
amit_mvb_dwn_err_erase 53 Memory erase error
amit_mvb_dwn_err_wrt 54 Data write error
amit_mvb_dwn_err_fw 55 New firmware data are not valid, firmware refused
amit_mvb_dwn_err_chksm 56 Invalid checksum
amit_mvb_dwn_err_len 57 Invalid data length
amit_mvb_dwn_err_sys 58 System download error
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 10/71
3.2. Description of services
Software of RM-MVB10/1x module provides a set of services through which the host CPU can access MVB ports, supervise MVB bus, control ACP/ANM protocol and read its status / diagnostic.
Following services are available:
Service Code Chapter
Writing the configuration service “C” 3.2.1
Reading the configuration service “c” 3.2.2
Writing the configuration extended service “N” 3.2.3
Reading the configuration extended service “n” 3.2.4
Writing the device status service “D” 3.2.5
Reading the device status service “d” 3.2.6
Reading the list of found devices service “I” 3.2.7
Reading the MVB statistics service “s” 3.2.8
Clearing the MVB statistics service “T” 3.2.9
Writing the ports configuration service “P” 3.2.10
Reading the ports configuration service “P” 3.2.11
Writing data to the port service “W” 3.2.12
Reading data from the port service “r” 3.2.13
Writing data to set of ports service “G” 3.2.14
Reading data from set of ports service “g” 3.2.15
Enabling the port service “E” 3.2.16
Disabling the port service “U” 3.2.17
Enabling set of ports service “S” 3.2.18
Disabling set of ports service “R” 3.2.19
Forcing data to the port service “F” 3.2.20
Unforcing data from the port service “X” 3.2.21
Unforcing all data from traffic store service “A” 3.2.22
Writing the ACP/ANM control “!” 3.2.23
Reading the ACP/ANM status service “?” 3.2.24
Clearing the journal service “J” 3.2.25
Reading the journal service “j” 3.2.26
3.2.1 Writing the configuration service
Writing the configuration service provides setting the device address and lines configuration.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (12 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing the configuration (“C”)
Command U8 Not used (0x00)
Sequence number U8 Session sequential number
Configuration U16 Device configuration
TCN-MVB-ACP
11/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
T_Reply U16 Reply timeout 0 – default reply (42.7 μs) 1 – ¼ reply (10.7 μs) 2 – ½ reply (21.4 μs) 3 – ¾ reply (32 μs) 4 – default reply (42.7 μs) 5 – 1 ¼ reply (53.4 μs) 6 – 1 ½ reply (64 μs) 7 – 1 ¾ reply (74.7 μs) 8 – double reply (85.4 μs)
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
The configuration item has following format:
Bit 15 Bit 14 Bit 12 – 13 Bit 0 – 11
Line A Line B MD Priority Device address
MVB A, B lines:
Line A Line B Meaning
0 0 Passive state, device reconfiguration (initial device state)
0 1 Reserved
1 0 Reserved
1 1 Regular state, operation on redundant MVB lines
MD priority (for devices of class 2 and higher only):
Bit 13 Bit 12 Meaning
0 0 Reserved
0 1 Messages low priority
1 0 Messages high priority
1 1 Reserved
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Writing the configuration (“C”)
Status U8 Return code of processing
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Device address 0 means that no change of device address is requested. Setting of device address is possible only in passive state. It is necessary to put the device into passive state first in case of request for device address change.
Device address = 16, message low priority, default reply timeout. Hexadump of request is: 10:02:0C:00:63:43:00:01 10:10:10:10:00:00:71:B4 10:03
Hexadump of response is: 10:02:08:00:72:43:00:01 93:F8:10:03
Note:
Example:
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 12/71
3.2.2 Reading the configuration service
Reading the configuration service provides reading of current device configuration and identification of MVB hardware and software. Device address 0 means, that no address has been set up yet.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading the configuration (“c”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (74 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading the configuration (“c”)
Status U8 Return code of processing
Sequential number U8 Session sequential number
Configuration U16 Device configuration
HW name String32 NULL terminated string with identification of MVB hardware and its version
SW name String32 NULL terminated string with identification of MVB software and its version
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
The Device configuration item has identical format with the same item in chapter “3.2.1 Writing the configuration service”. Hexadump of request: 10:02:08:00:63:63:00:02 25:23:10:03
Hexadump of response: 10:02:4A:00:72:63:00:02 10:10:10:10:52:4D:2D:4D 56:42:31:30:2F:31:31:20 31:00:00:00:00:00:00:00 00:00:00:00:00:00:00:00 00:00:00:00:41:4D:69:54 20:4D:56:42:20:6C:69:62 2D:56:31:2E:30:32:2D:31 31:2E:31:31:2E:32:30:31 33:00:00:00:0A:1A:10:03
Device address=16, message low priority, HW name=”RM-MVB10/11 1” SW name=”AMiT MVB lib-V1.02-11.11.2013”
Example:
TCN-MVB-ACP
13/71 tcn-mvb-acp_ms_en_118
3.2.3 Writing the configuration extended service
Writing the configuration extended service provides setting the device address, lines configuration and HW configuration.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (16 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing the configuration (“N”)
Command U8 Not used (0x00)
Sequence number U8 Session sequential number
Configuration U16 Device configuration
T_Reply U16 Reply timeout 0 – default reply (42.7 μs) 1 – ¼ reply (10.7 μs) 2 – ½ reply (21.4 μs) 3 – ¾ reply (32 μs) 4 – default reply (42.7 μs) 5 – 1 ¼ reply (53.4 μs) 6 – 1 ½ reply (64 μs) 7 – 1 ¾ reply (74.7 μs) 8 – double reply (85.4 μs)
HW interface cfg U8 0 – default configuration without optical control 1 – configuration with optical control
Reserved U8 Reserved
Reserved U16 Reserved
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
The configuration item is specified in chapter “3.2.1 Writing the configuration service”. Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Writing the configuration (“N”)
Status U8 Return code of processing
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Device address 0 means that no change of device address is requested. Setting of device address is possible only in passive state. It is necessary to put the device into passive state first in case of request for device address change.
Note:
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 14/71
3.2.4 Reading the configuration extended service
Reading the configuration extended service provides reading of current device configuration and identification of MVB hardware and software. Device address 0 means, that no address has been set up yet.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading the configuration (“n”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (76 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading the configuration (“n”)
Status U8 Return code of processing
Sequential number U8 Session sequential number
Configuration U16 Device configuration
HW name String32 NULL terminated string with identification of MVB hardware and its version
SW name String32 NULL terminated string with identification of MVB software and its version
HW interface cfg U8 0 – default configuration without optical control 1 – configuration with optical control
Reserved U8 Reserved
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
The Device configuration item has identical format with the same item in chapter “3.2.1 Writing the configuration service”.
3.2.5 Writing the device status service
Writing the device status service allows to set the device status. This status is then sent to other devices.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing the device status (“D”)
TCN-MVB-ACP
15/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Device status U16 Device status
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
When setting the device status, only SDD, DNR and SER bits can be affected. The other bits are set automatically by device itself.
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Writing the device status (“D”)
Status U8 Return code of processing
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.2.6 Reading the device status service
Reading the device status service allows to read status of device, identified by its device address.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading the device status (“d”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Device address U16 Device address
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Format of Device address item is as follows:
Bit 12 – 15 Bit 0 – 11
Reserved Device address
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (12 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading the device status (“d”)
Note:
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 16/71
Item Type Length
Meaning
Status U8 Return code of processing
Sequential number U8 Session sequential number
Device status U16 Device status
Freshness U16 Time, elapsed from last transmission of status from given device [ms]
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Device status of device itself is possible to read only after it has been sent on bus.
3.2.7 Reading the list of found devices service
Through reading the list of found devices service can be read the current list of found devices on the MVB bus. The list includes device address and device status for each found MVB device. By single frame can be read list of maximum 124 devices; in case that more devices are present on the MVB bus, it’s possible to read other MVB devices by entering of the appropriate set index.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading the list of found devices (“l” = 0x6C)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Set index U16 0 = set of first 124 devices, 1 = set of second 124 devices, …
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 + nr_devices * 4 + 4)
Request type Ch8 Response (“r”)
Service Ch8 Reading the list of found devices (“l” = 0x6C)
Status U8 Return code of processing
Sequential number U8 Session sequential number
Number of devices U16 Number of devices (maximum 124)
Device descriptor 1 U32 Descriptor of device No. 1
Device descriptor 2 U32 Descriptor of device No. 2
… … …
Device descriptor n U32 Descriptor of device No. n
Number of additional devices
U16 Number of devices in following sets, that did not fit into frame
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Note:
TCN-MVB-ACP
17/71 tcn-mvb-acp_ms_en_118
Device descriptor:
Bit 16 – 31 Bit 0 – 15
Device status Device address
3.2.8 Reading the MVB statistics service
Reading the MVB statistics provides reading MVB statistics and diagnostics counters.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading the MVB statistics (“s”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX U16 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX U16 Start Of Frame (0x10, 0x02)
Length U16 Frame length (104 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading the MVB statistics (“s”)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
Bus_timeout_cnt U32 Bus timeout counter
Reply_timeout_cnt U32 Reply timeout counter
Frame_lost_cnt U32 Frame lost counter
Frame_cnt U32 Frame counter
Frame_err_cnt U32 Counter of erroneous frames
Frame_err_a_cnt U32 Counter of erroneous frames on line A
Frame_err_b_cnt U32 Counter of erroneous frames on line B
Switch_cnt U32 Counter of line switches
Received master frame statistics
Valid_cnt U32 Counter of valid frames
Dupl_cnt U32 Counter of duplicated frames
Error_cnt U32 Counter of error frames
Manch_viol_cnt U32 Counter of manchester violation errors
Bus_not_idle_cnt U32 Counter of bus not idles
Over_balance_cnt U32 Counter of over balance errors
Signal_err_cnt U32 Counter of signal quality errors
Crc_err_cnt U32 Counter of CRC errors
Received slave frame statistics
Valid_cnt U32 Counter of valid frames
Dupl_cnt U32 Counter of duplicated frames
Error_cnt U32 Counter of error frames
Manch_viol_cnt U32 Counter of manchester violation errors
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 18/71
Item Type Length
Meaning
Bus_not_idle_cnt U32 Counter of bus not idles
Over_balance_cnt U32 Counter of over balance errors
Signal_err_cnt U32 Counter of signal quality errors
Crc_err_cnt U32 Counter of CRC errors
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.2.9 Clearing the MVB statistics service
Clearing the MVB statistics service provides reseting MVB statistics and diagnostics counters.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Clearing the MVB statistics (“T”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Clearing the MVB statistics (“T”)
Status U8 Return code of processing
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.2.10 Writing the ports configuration service
By writing the ports configuration service is possible to configure addresses, lengths and type of ports. By single frame can be configured up to 124 ports; when configuration of more ports is required, then is necessary to call this service more times. If the port has been configured formerly, new configuration replaces the original one (port is reconfigured). Each port can be configured as source, target (sink) or source and sink simultaneously. Ports can be configured only in passive state of MVB.
TCN-MVB-ACP
19/71 tcn-mvb-acp_ms_en_118
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 + nr_ports * 4 + 2 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing the ports configuration (“P”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Number of ports U16 Number of ports involved in configuration (maximum 124)
Port descriptor 1 U32 Descriptor of port No. 1
Port descriptor 2 U32 Descriptor of port No. 2
… … …
Port descriptor n U32 Descriptor of port No n.
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Port descriptor:
Bit 18 – 31 Bit 17 Bit 16 Bit 12 – 15 Bit 0 – 11
Reserved Src Snk Fcode Port address
Fcode:
Value Port length (bits)
0 16
1 32
2 64
3 128
4 256
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Writing the ports configuration (“P”)
Status U8 Return code of processing
Sequential number U8 Session sequential number
Number of ports U16 Number of processed ports
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
After configuration port remains passive. Data can be written into passive source port, but they are not transmitted on bus. From passive sink port data can be read, but they are not received from bus. Port is enabled by service Enabling the port. It allows application to ensure, that only valid data prepared in advance are sent/received on/from the bus (important namely with device reconfiguration). Sink port and source port can be written using one descriptor or two descriptors placed just behind.
Note:
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 20/71
Configuration of 6 ports: 1. Port source, address = 220h, fcode = 3 2. Port source, address = 221h, fcode = 4 3. Port source, address = 222h, fcode = 2 4. Port sink, address = 300h, fcode = 1 5. Port sink, address = 301h, fcode = 3 6. Port sink, address = 302h, fcode = 0
Hexadump of request is: 10:02:22:00:63:50:00:03 06:00:20:32:02:00:21:42 02:00:22:22:02:00:00:13 01:00:01:33:01:00:02:03 01:00:74:9B:10:03
Hexadump of response is: 10:02:0A:00:72:50:00:03 06:00:5A:88:10:03
3.2.11 Reading the ports configuration service
Through reading the ports configuration service can be read the current configuration of all ports. By single frame can be read configuration of maximum 124 ports; in case that more ports is configured, it’s possible to read other ports by entering of the appropriate set index.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading the ports configuration (“p”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Set index U16 0 = set of first 124 ports, 1 = set of second 124 ports, …
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 + nr_ports * 4 + 4 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading the ports configuration (“p”)
Status U8 Return code of processing
Sequential number U8 Session sequential number
Number of ports U16 Number of ports in set (maximum 124)
Port descriptor 1 U32 Descriptor of port No. 1
Port descriptor 2 U32 Descriptor of port No. 2
… … …
Port descriptor n U32 Descriptor of port No. N
Number of additional ports
U16 Number of ports in following sets, that did not fit into frame
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Example:
TCN-MVB-ACP
21/71 tcn-mvb-acp_ms_en_118
Port descriptor:
Bit 22 – 31 Bit 21 Bit 20 Bit 19 Bit 18 Bit 17 Bit 16 Bit 12 – 15 Bit 0 – 11
Reserved Src Snk Twc Frc Src Snk Fcode Port address Current configuration Static
configuration
The current port configuration is given by combination of following flags:
Flag Meaning Description
Src Source Source port
Snk Sink Destination port
Twc Transfer with checksum
Transfer of process data with checksum (for debugging only)
Frc Force In the port is stored the replacement data (see chapter “3.2.20 Forcing data to the port service”)
When neither Src nor Snk flags are set at dynamic configuration, the port is passive.
3.2.12 Writing data to the port service
The service provides writing data into source port.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 + datset_length + 2)
Request type Ch8 Request (“c”)
Service Ch8 Writing data to the port (“W”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Port identification U16 Port length (fcode) and address
Dataset … Port contents
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Port identification:
Bit 12 – 15 Bit 0 – 11
Fcode Port address
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Writing data to the port (“W”)
Status U8 Return code of processing
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
It is not possible to write data into sink port, alternatively into port which is not configured.
Note:
Note:
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 22/71
The port fcode must agree with previous configuration.
When data is entered into port, it is not passed immediately onto bus: the port must be first enabled (see chapter Enabling port service) and data is sent when the port is asked for transfer by master.
When writing data into port the force can be eventually applied (see chapter “3.2.20 Forcing data to the port service”).
3.2.13 Reading data from the port service
By reading data from the port service is read the appropriate dataset from port.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading data from the port (“r”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Port identification U16 Port length (fcode) and address
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 + dataset_length + 2 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading data from the port (“r”)
Status U8 Return code of processing
Sequential number U8 Session sequential number
Freshness U16 Time, elapsed from last data transmission to port [ms]
Dataset … Port contents
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Data cannot be read from port, which is not configured. If the port is configured as source and at the same time as sink, data is read from sink port part. When reading data from port the forcing can be eventually applied (see chapter “3.2.20 Forcing data to the port service”).
Note:
TCN-MVB-ACP
23/71 tcn-mvb-acp_ms_en_118
3.2.14 Writing data to set of ports service
By writing data to set of ports service can be data written simultaneously into more source ports.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 + nr_ports * 2 + nr_ports * dataset_length + 2 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing data to set of ports (“G”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Number of ports U16 Number of ports (maximum 124 for 16-bit ports)
Identification of 1. port U16 Port No. 1 length (fcode) and address
Identification of 2. port U16 Port No. 2 length (fcode) and address
… … …
Identification of n. port U16 Port No. n length (fcode) and address
Dataset 1 … Contents of 1. port
Dataset 2 … Contents of 2. port
… … …
Dataset n … Contents of n. port
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Writing data to set of ports (“G”)
Status U8 Return code of processing
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Data consistency is guaranteed only within contents of single port (dataset), but not between individual ports. Dataset is transferred always as a whole.
3.2.15 Reading data from set of ports service
Reading data from set of ports service is used for reading more dataset from ports.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 + nr_ports * 2 + 2 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading data from set of ports (“g”)
Note:
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 24/71
Item Type Length
Meaning
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Number of ports U16 Number of ports (maximum 124 for 16-bit ports)
Identification of 1. port
U16 Port No. 1 length (fcode) and address
Identification of 2. port
U16 Port No. 2 length (fcode) and address
… … …
Identification of n. port
U16 Port No. n length (fcode) and address
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 + nr_ports * (2 + dataset_length) + 2 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading data from set of ports (“g”)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
Number of ports U16 Number of read ports (maximum 124 for 16-bit ports)
Freshness 1 U16 Time, elapsed from last data transmission to 1. port [ms]
Dataset 1 … Contents of 1. Port
Freshness 2 U16 Time, elapsed from last data transmission to 2. port [ms]
Dataset 2 … Contents of 2. Port
… … …
Freshness n U16 Time, elapsed from last data transmission to n. port [ms]
Dataset n … Contents of n. port
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
If the datasets are longer than maximum data length of frame, less ports is read.
3.2.16 Enabling the port service
By enabling the port service is enabled transmitting/receiving data from/to port to/from bus.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 bytes)
Request type Ch8 Request (“c”)
Note:
TCN-MVB-ACP
25/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
Service Ch8 Enabling the port (“E”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Port address U16 Port address
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Enabling the port (“E”)
Status U8 Return code of processing
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Recommended procedure for application is: first of all write data into source port through Write data to port service and after then enable transmitting of data from port. By this way is guaranteed validity of dataset which is transmitted to bus.
3.2.17 Disabling the port service
Disabling the port service is disabled transmitting/receiving data from/to port to/from bus(es).
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Disabling the port (“U”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Port address U16 Port address
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Disabling the port (“U”)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
Note:
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 26/71
Item Type Length
Meaning
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
When application stops to produce data to certain ports (for instance due to change of operation state), it’s recommended to disable these ports. By this is guaranteed, that data in sink ports become of outdated for potential consumers.
3.2.18 Enabling set of ports service
This service allows enabling more ports at once. For more information please refer to the Enabling the port service.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 + nr_ports * 2 + 2 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Enabling set of ports (“S”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Number of ports U16 Number of ports (maximum 124)
Port address 1 U16 Address of 1. port
Port address 2 U16 Address of 2. port
... ...
Port address n U16 Address of n. port
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Enabling set of ports (“S”)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.2.19 Disabling set of ports service
This service allows disabling more ports at once. For more information please refer to the Enabling the port service.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 + nr_ports * 2 + 2 bytes)
Note:
TCN-MVB-ACP
27/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
Request type Ch8 Request (“c”)
Service Ch8 Disabling set of ports (“R”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Number of ports U16 Number of ports (maximum 124)
Port address 1 U16 Address of 1. port
Port address 2 U16 Address of 2. port
... ...
Port address n U16 Address of n. port
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Disabling set of ports (“R”)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.2.20 Forcing data to the port service
Forcing data to the port service allows transmitted (from source port) or received (by sink port) a substitute data instead of real data.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 + dataset_length * 2 + 2 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Forcing data to the port (“F”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Port identification U16 Port length (fcode) and address
Force data … Substitute data
Force mask … Substitute data mask
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 28/71
Item Type Length
Meaning
Service Ch8 Forcing data to the port (“F”)
Status U8 Return code of processing
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
If a substitute data are stored in port, then „force“ flag for corresponding port dynamic configuration and „frc“ flag in device status are set.
3.2.21 Unforcing data from the port service
By unforcing data from the port service are removed the substitute data from port.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 + dataset_length + 2 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Unforcing data from the port (“X”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Port identification U16 Port length (fcode) and address
Unforce mask … Mask for force data cancelling
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Unforcing data from the port (“X”)
Status U8 Return code of processing
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
When force is cancelled for source port, the substitute data are not removed immediately, but there are overwritten by new real data from application.
3.2.22 Unforcing all data from traffic store service
Unforcing all data from traffic store service removes the force data from all ports in traffic store.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Note:
Note:
TCN-MVB-ACP
29/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
Request type Ch8 Request (“c”)
Service Ch8 Unforcing all data from traffic store (“A”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Unforcing all data from traffic store (“A”)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.2.23 Writing the ACP/ANM control
Writing the ACP/ANM control provides settings of timeouts and reseting of statistics counters.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (20 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing the ACP/ANM control (“!”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Command mask U32 Mask of commands to be executed: 0x1 – configuration of timeouts 0x2 – reset of statistics of ANM protocol 0x4 – reset of statistics of ACP protocol
Alive timeout U32 Timeout of waiting for duplicated frame [ms]
Session timeout U32 Timeout of waiting for the end of the session [ms]
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (12 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Writing the ACP/ANM control (“!”)
Status U8 Return code of processing state
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 30/71
Item Type Length
Meaning
Sequential number U8 Session sequential number
Timeouts result U8 Result of configuration timeouts
ANM result U8 Result of reseting ANM protocol statistics
ACP result U8 Result of reseting ACP protocol statistics
Reserved U8 Reserved
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
It is recommended to set up alive timeout as session timeout * 2.5
3.2.24 Reading the ACP/ANM status service
Reading the ACP/ANM status provides reading of the library version and reading of ACP/ANM statistics and diagnostics counters.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading the ACP/ANM status (“?”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (172 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading the ACP/ANM status (“?”)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
Manufacturer String32 NULL terminated string with name of manufacturer of device
Timestamp U32 UNIX timestamp of ACP/ANM library release
Version U16 Version of the ACP/ANM library release
Revision U16 Revision of the ACP/ANM library release
Build U16 Build of the ACP/ANM library release
Reserved U16 Reserved
ANM_tx_cnt U32 Counter of transmit ANM responses
ANM_tx_rfs_cnt U32 Counter of refused ANM responses
ANM_rx_cnt U32 Counter of received ANM requests
ANM_rx_rfs_cnt U32 Counter of refused ANM requests
ACP_alive_tmo U32 Timeout of waiting for duplicated frame [ms]
ACP_session_tmo U32 Timeout of waiting for the end of the session [ms]
ACP_tx_cnt U32 Counter of transmit ACP datagrams
Note:
TCN-MVB-ACP
31/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
ACP_tx_err_cnt U32 Counter of ACP datagrams which were impossible to transmit
ACP_rx_cnt U32 Counter of received ACP datagrams
ACP_rx_err_cnt U32 Counter of ACP datagrams received with error
ALI_tx_cnt U32 Counter of transmit ALI frames
ALI_tx_cnt_err U32 Counter of ALI frames which were impossible to transmit
ALI_rx_cnt U32 Counter of received ALI frames
ALI_rx_err_cnt U32 Counter of ALI frames received with error
ALI_rx_no_free_cnt U32 Counter of no free buffers
ALI_rx_out_stx_cnt U32 Counter of out sequence DLE STX
ALI_rx_out_etx_cnt U32 Counter of out sequence DLE ETX
ALI_rx_out_dle_cnt U32 Counter of unknown DLE sequences
ALI_rx_bad_len_cnt U32 Counter of received frames with incorrect length
ALI_rx_bad_crc_cnt U32 Counter of frames with incorrect CRC
ALI_rx_que_err_cnt U32 Counter of queue errors
ASISI_tx_cnt U32 Counter of transmit ASISI frames
ASISI_tx_cnt_err U32 Counter of ASISI frames which were impossible to transmit
ASISI_rx_cnt U32 Counter of received ASISI frames
ASISI_rx_err_cnt U32 Counter of ASISI frames received with error
ASISI_rx_dma_cnt U32 Counter of received ASISI frames with DMA error
ASISI_rx_to_cnt U32 Counter of ASISI frames with TO error
ASISI_rx_que_err_cnt U32 Counter of ASISI queue errors
ASISI_rx_bad_hdr_cnt U32 Counter of ASISI frames with incorrect header
ASISI_bad_nss_cnt U32 Counter of incorrect NSS states
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.2.25 Clearing the journal service
Clearing the journal service provides clearing of the main and extra journal. After calling this service the main and extra journal are empty.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Clearing the journal service (“J”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 32/71
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Clearing the journal service (“J”)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.2.26 Reading the journal service
Reading the journal service provides reading of parameters, reading of records identified by start id and end id and reading of last records of the journal. It is possible to read maximum of 4 journal records by one command.
Common request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (min. 10 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading the journal service (“j”)
Command U8 1 – reading of journal parameters 2 – reading of journal records identified by start_id and
end_id 3 – reading of last journal records
Sequential number U8 Session sequential number
Reserved U8 Reserved
Journal_Type U8 Type of the journal: 0 – main journal 1 – extra journal
... ... Parameters depending on the type of command
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Reading of journal parameters request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading the journal service (“j”)
Command U8 1 – reading of journal parameters
Sequential number U8 Session sequential number
Reserved U8 Reserved
Journal_Type U8 Type of the journal: 0 – main journal 1 – extra journal
TCN-MVB-ACP
33/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Reading of journal parameters response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (16 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading the journal service (“j”)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
Total length U16 Total length of the journal
Current length U16 The current number of records in the journal
Oldest ID U16 The unique identification of the oldest record
Newest ID U16 The unique identification of the newest record
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Reading of the journal records identified by start id and end id request format:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading the journal service (“j”)
Command U8 2 – reading of journal records identified by start_id and end_id
Sequential number U8 Session sequential number
Reserved U8 Reserved
Journal_Type U8 Type of the journal: 0 – main journal 1 – extra journal
Start ID U16 Unique identification of the first record to be read
End ID U16 Unique identification of the last record to be read
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Reading of the journal records response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 + nr_records * 108 + 2 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading the journal service (“j”)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
Records number U32 Number of journal records in the frame
Time stamp secs 1 U32 UTC number of seconds of first record
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 34/71
Item Type Length
Meaning
Time stamp ticks 1 U16 Number of ticks (1/65536s) of first record
Reserved 1 U16 Reserved
File name 1 String16 __FILE__ of the first record
Line number 1 U16 __LINE__ of the first record
Reserved 1 U8 Reserved
Event type 1 U8 Type of the event of the first record 0 – information 1 – warning 2 – error
Event description 1 String78 Event description of the first record
Reserved 1 U16 Reserved
Time stamp secs 2 U32 UTC number of seconds of second record
Time stamp ticks 2 U16 Number of ticks (1/65536s) of second record
Reserved 2 U16 Reserved
File name 2 String16 __FILE__ of the second record
Line number 2 U16 __LINE__ of the second record
Reserved 2 U8 Reserved
Event type 2 U8 Type of the event of the second record 0 – information 1 – warning 2 – error
Event description 2 String78 Event description of the second record
Reserved 2 U16 Reserved
... ... ...
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Reading of the last journal records request format:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading the journal service (“j”)
Command U8 3 – reading of last journal records
Sequential number U8 Session sequential number
Reserved U8 Reserved
Journal_Type U8 Type of the journal: 0 – main journal 1 – extra journal
Number of last records
U16 Number of last records
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
The response format is the same as in reading journal records identified by ids.
TCN-MVB-ACP
35/71 tcn-mvb-acp_ms_en_118
3.3. Description of services for MD communication (class 2)
AMI result codes
Return codes are as follows:
Return code Value Meaning
Standard codes
am_ok 0 all is OK
am_failure 1 unspecified failure
am_bus_err 2 no bus transmission possible
am_rem_conn_ovf 3 too many incoming connections
am_conn_tmo_err 4 connect request not answered
am_send_tmo_err 5 send timeout (connect was ok)
am_reply_tmo_err 6 session timeout
am_alive_tmo_err 7 no complete message received
am_loc_no_mem_err 8 not enough memory or timers
am_rem_canc_err 10 canceled by partner
am_already_used 11 same operation already done
am_no_reply_exp_err 13 no such reply expected error
am_nr_of_conv_ovf 14 too many calls requested
am_reply_len_ovf 15 reply message too long
am_dupl_conv_err 16 duplicated conversation error
am_no_ready_inst_err 18 no ready instance error
am_call_len_ovf 20 call message too long
am_unknown_dest_err 21 unknown destination address
am_inaug_err 22 train inauguration occurred
am_try_later_err 23 the request shall be repeated after send timeout
am_gw_ori_reg_err 26 origin is not registered in router
am_repeat_tmo_err 27 the conversation was not setup (repeat timeout)
am_try_later_alive_err 29 the request shall be repeated after send timeout, maximum is alive timeout
User codes
am_not_init 60 interface is not initialized
am_already_init 61 interface is already initialized
am_int_fatal_err 62 corrupted internal structures
am_descr_not_init 63 network descriptor is not initialized
am_bus_unknw_type 64 unknown or unsupported bus type
am_bus_wtb_dupl 65 duplicated train bus
am_bus_lm_err 66 error on LMI or LMA
am_route_dir_err 67 error while access routing directories
am_tx_pool_empty 68 transmit packet pool is empty
am_rx_pool_empty 69 receive packet pool is empty
Errors on local station
am_loc_next_not_found 71 next_station (router) not found in station directory
am_loc_topo_cnt_err 72 Incorrect combination of address and topo_counter
am_loc_not_node 73 station is not node (it is not connected WTB)
am_loc_rout_fct_nset 74 router function is not set
am_loc_sta_next_err 75 incorrect combination of final station and router
am_loc_fct_next_err 76 incorrect combination of function and router
am_loc_sta_not_found 79 station not found in station directory
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 36/71
Return code Value Meaning
am_loc_fct_not_found 80 function not found in function directory
am_loc_pck_unknw 81 unknown or unsupported packet type
am_loc_pck_bad_len 82 incorrect packet length
am_loc_pck_bad 85 incorrect data in packet
am_loc_pck_no_state 87 no state for incoming packet
Errors on remote station
am_rem_next_not_found 89 next_station (router) not found in station directory
am_rem_topo_cnt_err 90 Incorrect combination of address and topo_counter
am_rem_not_node 91 station is not node (it is not connected WTB)
am_rem_rout_fct_nset 92 router function is not set
am_rem_sta_next_err 93 incorrect combination of final station and router
am_rem_fct_next_err 94 incorrect combination of function and router
am_rem_sta_not_found 97 station not found in station directory
am_rem_fct_not_found 98 function not found in function directory
am_rem_pck_unknw 99 unknown or unsupported packet type
am_rem_pck_bad_len 100 incorrect packet length
am_rem_data_size_ovr 101 length of receive data exceeds message length
am_rem_data_size_less 102 message exceeds length of receive data
am_rem_pck_bad 103 incorrect data in packet
am_rem_pck_no_state 105 no state for incoming packet
Errors on network layer
am_return_path_bad 110 test of packet return path fails
am_bad_net_header 111 incorrect network packet header
AMI input errors
am_bad_params 112 incorrect input parameters to AMI function
Errors on transport layer
am_conv_not_found 115 conversation not found
am_invalid_event 116 incorrect or unsupported event
am_no_free_event 117 no free event
Errors on session layer
am_sta_id_not_set 120 station id has not yet assigned to this station
am_sta_id_bad 121 incorrect identification of station
am_fct_reg_too_many 122 too many registered functions
am_fct_unreg_caller 123 no caller is registered to given function
am_fct_unreg_replier 124 no replier is registered to given function
am_fct_not_manager 125 only manager function can use system addressing
am_fct_add_fundi_err 126 error while adding function into function directory
am_fct_already_def 127 function is defined on another station
am_dir_write_err 128 error while writing into routing directories
am_dir_delete_err 129 some entries were not deleted from directory
am_dir_entrs_more 130 not all entries were read from directory
TCN-MVB-ACP
37/71 tcn-mvb-acp_ms_en_118
Following services are available:
Service Code Chapter
Reading the station identifier service 0x80 3.3.1
Writing the station identifier service 0x81 3.3.2
Reading the routing directories service 0x82 3.3.3
Writing the routing directories service 0x83 3.3.4
Reading the TCN messenger status 0x84 3.3.5
Writing the TCN messenger control 0x85 3.3.6
Registration of caller and replier functions 0x87 3.3.7
Cancel previous registration of caller and replier functions 0x89 3.3.8
Reading states of MD instances 0x90 3.3.9
Writing control of the caller instance 0x91 3.3.10
Writing control of the replier instance 0x93 3.3.11
3.3.1 Reading the station identifier service
This service provides information about the station identifier of device itself.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading the station identifier service (0x80)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading the station identifier service (0x80)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
Station identifier U8 8-bit station identifier (255 = identifier not set)
Reserved U8 Reserved
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.3.2 Writing the station identifier service
This service provides setting of station identifier of the device itself.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 bytes)
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 38/71
Item Type Length
Meaning
Request type Ch8 Request (“c”)
Service Ch8 Writing the station identifier service (0x81)
Command U8 Not used (0x00)
Sequential number
U8 Session sequential number
Station identifier U8 8-bit station identifier
Reserved U8 Reserved
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Writing the station identifier service (0x81)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.3.3 Reading the routing directories service
This service provides reading the content of routing directories (station, function and group directory).
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading the routing directories service (0x82)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Directory_Type U8 Type of the directory: 1 – station directory 2 – function directory 3 – group directory
Reserved U8 Reserved
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Common response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
TCN-MVB-ACP
39/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
Service Ch8 Reading the routing directories service (0x82)
Status U8 Return code of processing
Sequential number U8 Session sequential number
Entries number U32 Number of directory entries
Directory ... Depending on the type of the directory
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Station directory response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 + nr_entries * 8 + 2 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading the routing directories service (0x82)
Status U8 Return code of processing
Sequential number U8 Session sequential number
Entries number U32 Number of directory entries
Station directory entry No. 1
Reserved U8 Reserved
Final station id U8 Identification of the final station
Next station id U8 Identification of the next (router) station
Bus identification U8 Identification of the bus
Device address U32 Device address
Station directory entry No. 2
Reserved U8 Reserved
Final station id U8 Identification of the final station
Next station id U8 Identification of the next (router) station
Bus identification U8 Identification of the bus
Device address U32 Device address
... ... ...
Station directory entry No. n
Reserved U8 Reserved
Final station id U8 Identification of the final station
Next station id U8 Identification of the next (router) station
Bus identification U8 Identification of the bus
Device address U32 Device address
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Function directory response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 + nr_entries * 2 + 2 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading the routing directories service (0x82)
Status U8 Return code of processing
Sequential number U8 Session sequential number
Entries number U32 Number of directory entries
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 40/71
Item Type Length
Meaning
Function directory entry No. 1
Function id U8 Identification of the function
Station id U8 Identification of the station which provides the function
Function directory entry No. 2
Function id U8 Identification of the function
Station id U8 Identification of the station which provides the function
... ... ...
Function directory entry No. n
Function id U8 Identification of the function
Station id U8 Identification of the station which provides the function
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Group directory response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 + nr_entries + 2 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading the routing directories service (0x82)
Status U8 Return code of processing
Sequential number U8 Session sequential number
Entries number U32 Number of directory entries
Group 1 U8 Identification of the 1st group
Group 2 U8 Identification of the 2nd group
... ... ...
Group n U8 Identification of the group No. n
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.3.4 Writing the routing directories service
This service provides writing of entries into the routing directories (station, function and group directory). The maximum number of entries is 62 for the station directory, 249 for the function directory and 64 for the group directory.
Common request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (min. 10 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing the routing directories service (0x83)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Directory_Type U8 Type of the directory: 1 – station directory 2 – function directory 3 – group directory
Reserved U8 Reserved
TCN-MVB-ACP
41/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
Number of entries U16 Number of directory entries
Directory ... Depending on the type of the directory
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Writing station directory request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 + nr_entries * 8 + 2 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing the routing directories service (0x83)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Directory_Type U8 1 – station directory
Reserved U8 Reserved
Number of entries U16 Number of station directory entries
Station directory entry No. 1
Reserved U8 Reserved
Final station id U8 Identification of the final station
Next station id U8 Identification of the next (router) station
Bus identification U8 Identification of the bus
Device address U32 Device address
Station directory entry No. 2
Reserved U8 Reserved
Final station id U8 Identification of the final station
Next station id U8 Identification of the next (router) station
Bus identification U8 Identification of the bus
Device address U32 Device address
... ... ...
Station directory entry No. n
Reserved U8 Reserved
Final station id U8 Identification of the final station
Next station id U8 Identification of the next (router) station
Bus identification U8 Identification of the bus
Device address U32 Device address
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Writing function directory request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 + nr_entries * 2 + 2 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing the routing directories service (0x83)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Directory_Type U8 2 – function directory
Reserved U8 Reserved
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 42/71
Item Type Length
Meaning
Number of entries U16 Number of directory entries
Function directory entry No. 1
Function id U8 Identification of the function
Station id U8 Identification of the station which provides the function
Function directory entry No. 2
Function id U8 Identification of the function
Station id U8 Identification of the station which provides the function
... ... ...
Function directory entry No. n
Function id U8 Identification of the function
Station id U8 Identification of the station which provides the function
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Writing group directory request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 + nr_entries + 2 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing the routing directories service (0x83)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Directory_Type U8 3 – group directory
Reserved U8 Reserved
Number of entries U16 Number of directory entries
Group 1 U8 Identification of the 1st group
Group 2 U8 Identification of the 2nd group
... ... ...
Group n U8 Identification of the group No. n
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Writing the routing directories service (0x83)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.3.5 Reading the TCN messenger status
This service provides information about the configuration of TCN messenger and the statistics of send/receive messages, packets and frames.
TCN-MVB-ACP
43/71 tcn-mvb-acp_ms_en_118
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading the TCN messenger status (0x84)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (124 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading the TCN messenger status (0x84)
Status U8 Return code of processing
Sequential number U8 Session sequential number
Name String32 Name and version of the TCN messenger library
Compatibility Enum8 Group of the TCN messenger compatibility 1 – interoperable version (compatibility FAR system,
Duagon) 2 – homologated version (compatibility testbed,
Siemens, Bombardier) 3 – standard version (compatibility TCN standard, EKE,
UniControls, Skoda)
Reserved1 U8 Reserved
Max_nr_fcts U16 Maximal number of functions to be registered
Session layer
Heap length U32 Total memory length on the heap for messages
Heap free U32 Free memory length on the heap for messages
Nr_instances U32 Number of instances on the session layer
Sess_timeout U32 Timeout of waiting for the reply message
Msg_sent_nr U32 Number of sent messages
Msg_recv_nr U32 Number of received messages
Transport layer
Send_timeout U32 Timeout of waiting for the confirmation of conversation
Ack_timeout U32 Timeout of waiting for the data window
Alive_timeout U32 Timeout of conversation itself
MC_send_tmo U32 Send timeout of multicast communication
MC_pause_tmo U32 Pause timeout of multicast communication
Nr_instances U8 Number of instances on the transport layer
Credit U8 Maximal size of the slide window
Packet size U8 Maximum size of the packet [bytes]
MC window size U8 Size of the slide window for MC communication
MC credit U32 Credit for the multicast communication
Tx_packets_nr U32 Number of packets sent
Tx_packets_retrs U32 Number of packets retries
Rx_packets_nr U32 Number of received packets
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 44/71
Item Type Length
Meaning
Rx_packets_bad U32 Number of incorrect received packets
MC_packets_retrs U32 Number of packets retries for multicast communication
Network layer
Tx_frames_nr U32 Number of transmit frames
Rx_frames_nr U32 Number of received frames
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.3.6 Writing the TCN messenger control
This service provides configuration of the TCN messenger library and controls of the TCN messenger statistics and diagnostics. The unused fields shall be fill with 0.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (46 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing the TCN messenger control (0x85)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Command mask U32 Mask of the commands: 0x00000001 – reset statistics counters 0x00000002 – set credit 0x00000004 – set packet size 0x00000008 – set session timeout 0x00000010 – set transport (conversation) timeouts 0x00000020 – enable print of packet types into the
journal 0x00000040 – disable print of packet types into the
journal 0x00000080 – enable dump of packets into the journal 0x00000100 – disable dump of packets into the journal 0x00000200 – set group of the compatibility
Session layer
Sess_timeout U32 Timeout of the session layer
Transport layer
Send_timeout U32 Timeout of waiting for the confirmation of conversation
Ack_timeout U32 Timeout of waiting for the acknowledge
Alive_timeout U32 Timeout of conversation itself
MC_send_tmo U32 Send timeout of multicast communication
MC_pause_tmo U32 Pause timeout of multicast communication
Credit U8 Maximal size of the slide window
Packet size U8 Maximal size of the packet [bytes]
Reserved U16 Reserved
MC_credit U32 Credit for the multicast communication
TCN-MVB-ACP
45/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
Compatibility Enum8 Group of the TCN messenger compatibility 1 – interoperable version (compatibility FAR system, Duagon) 2 – homologated version (compatibility testbed, Siemens, Bombardier) 3 – standard version (compatibility TCN standard, EKE, UniControls, Skoda) 4 – MICAS system
Reserved U8 Reserved
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Writing the TCN messenger control (0x85)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.3.7 Registration of caller and replier functions
This service provides registration of TCN caller and replier functions. This registration is required before sending or receiving TCN messages.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 + nr_functions * 2 + 2 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Registration of caller and replier functions (0x87)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Nr_functions U32 Number of functions to be registered (max. 124 functions in one frame)
Function descriptor No. 1
Function id U8 Identification of function
User type U8 Type of the user: 1 – TCN caller user 2 – TCN replier user
Function descriptor No. 2
Function id U8 Identification of function
User type U8 Type of the user: 1 – TCN caller user 2 – TCN replier user
... ... ...
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 46/71
Item Type Length
Meaning
Function descriptor No. n
Function id U8 Identification of function
User type U8 Type of the user: 1 – TCN caller user 2 – TCN replier user
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 + nr_handles * 4 + 2 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Registration of caller and replier functions (0x87)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
Nr_handles U32 Number of handles of registered functions
Fct_handle 1 U32 Handle of 1st registered function
Fct_handle 2 U32 Handle of 2nd registered function
... ... ...
Fct_handle n U32 Handle of nth registered function
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Each function can be registered for the caller and replier together.
It is impossible to register functions which are present in the function directory as functions which are provided on another stations.
After successful registration the function is automatically add to the function directory as local function.
3.3.8 Cancel previous registration of caller and replier functions
This service provides unregistration of previously registered caller and replier functions.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 + nr_functions * 8 + 2 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Unregistration of caller and replier functions (0x89)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
Nr_functions U32 Number of functions to be unregistered
Note:
TCN-MVB-ACP
47/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
Function descriptor No. 1
Function id U8 Identification of function
User type U8 Type of the user: 1 – TCN caller user 2 – TCN replier user
Reserved U16 Reserved
Fct_handle U32 Function handle returned in registration
Function descriptor No. 2
Function id U8 Identification of function
User type U8 Type of the user: 1 – TCN caller user 2 – TCN replier user
Reserved U16 Reserved
Fct_handle U32 Function handle returned in registration
... ... ...
Function descriptor No. n
Function id U8 Identification of function
User type U8 Type of the user: 1 – TCN caller user 2 – TCN replier user
Reserved U16 Reserved
Fct_handle U32 Function handle returned in registration
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Unregistration of caller and replier functions (0x89)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.3.9 Reading states of MD instances
This service provides reading states of all MD instances.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading states of all MD instances (0x90)
Command U8 Not used (0x00)
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 48/71
Item Type Length
Meaning
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (10 + nr_instances * 32 + 2 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading states of all MD instances (0x90)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
Nr_instances U32 Number of instances
Instance No. 1
Inst_handle U32 Handle (identification) of the instance. This handle can be used in control instance services.
User Enum8 Instance user: 0 – undefined user 1 – caller user 2 – replier user
State Enum8 State of the instance Common: 0 – free 7 – end Caller: 2 – call loading 3 – call ready 4 – calling 5 – call end 6 – reply storing Replier: 1 – call received 2 – call storing 3 – wait reply 4 – reply loading 5 – reply ready 6 – replying
Return code Enum8 Msg/AMI result code
Reserved U8 Reserved
Call length U32 Length of the call message
Reply length U32 Length of the reply message
User ref U32 External user identification
Partner address
Address type Enum8 Type of the address: 0 – individual user (functional) address 1 – individual system address 2 – group user (functional) address 3 – group system address
Node or group U8 Address of the node (individual addressing) or address of the group (group addressing)
TCN-MVB-ACP
49/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
Function or station
U8 Address of the function (user addressing) or station (system addressing)
Next station U8 Address of the next station in case of bypassing function directory
Local address
Fct_id U8 Identification of the caller function
Topo_cnt U8 Topo_counter supplied by the application 0 – local communication within node
Reserved U16 Reserved
Fct_handle U32 Handle of the function returned by the registering caller function service (not used for the replier)
Instance No. 2
Inst_handle U32 Handle (identification) of the instance. This handle can be used in control instance services.
User Enum8 Instance user: 0 – undefined user 1 – caller user 2 – replier user
State Enum8 State of the instance Common: 0 – free 7 – end Caller: 2 – call loading 3 – call ready 4 – calling 5 – call end 6 – reply storing Replier: 1 – call received 2 – call storing 3 – wait reply 4 – reply loading 5 – reply ready 6 – replying
Return code Enum8 Msg/AMI result code
Reserved U8 Reserved
Call length U32 Length of the call message
Reply length U32 Length of the reply message
User ref U32 External user identification
Partner address
Address type Enum8 Type of the address: 0 – individual user (functional) address 1 – individual system address 2 – group user (functional) address 3 – group system address
Node or group U8 Address of the node (individual addressing) or address of the group (group addressing)
Function or station
U8 Address of the function (user addressing) or station (system addressing)
Next station U8 Address of the next station in case of bypassing function directory
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 50/71
Item Type Length
Meaning
Local address
Fct_id U8 Identification of the caller function
Topo_cnt U8 Topo_counter supplied by the application 0 – local communication within node
Reserved U16 Reserved
Fct_handle U32 Handle of the function returned by the registering caller function service (not used for the replier)
... ... ...
Instance No. n
Inst_handle U32 Handle (identification) of the instance. This handle can be used in control instance services.
User Enum8 Instance user: 0 – undefined user 1 – caller user 2 – replier user
State Enum8 State of the instance Common: 0 – free 7 – end Caller: 2 – call loading 3 – call ready 4 – calling 5 – call end 6 – reply storing Replier: 1 – call received 2 – call storing 3 – wait reply 4 – reply loading 5 – reply ready 6 – replying
Return code Enum8 Msg/AMI result code
Reserved U8 Reserved
Call length U32 Length of the call message
Reply length U32 Length of the reply message
User ref U32 External user identification
Partner address
Address type Enum8 Type of the address: 0 – individual user (functional) address 1 – individual system address 2 – group user (functional) address 3 – group system address
Node or group U8 Address of the node (individual addressing) or address of the group (group addressing)
Function or station
U8 Address of the function (user addressing) or station (system addressing)
Next station U8 Address of the next station in case of bypassing function directory
TCN-MVB-ACP
51/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
Local address
Fct_id U8 Identification of the caller function
Topo_cnt U8 Topo_counter supplied by the application 0 – local communication within node
Reserved U16 Reserved
Fct_handle U32 Handle of the function returned by the registering caller function service (not used for the replier)
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.3.10 Writing control of the caller instance
This service provides control of the caller instance. Using this service the user controls sending the call message and receiving the reply message. The state machine of the caller instance is as follows:
State Command or event Next state
Free Allocation of the new instance Call loading
Call loading Loading the call message Call loading or Call ready
Destruction of the instance Free
Call ready No command or event Calling
Destruction of the instance Free
Calling Call sent and received reply Call end
Destruction of the instance Free
Call end Storing the reply message Reply storing or End
Destruction of the instance Free
Reply storing Storing the reply message Reply storing or End
Destruction of the instance Free
End No command or event Free
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (min. 12 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing control of the caller instance (0x91)
Command U8 Command to control the caller instance: 1 – allocation of the new instance 2 – loading the call message 3 – storing the reply message 4 – destruction of the instance 5 – get state of the instance
Sequential number U8 Session sequential number
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 52/71
Item Type Length
Meaning
Allocation of the new instance
Replier address
Address type Enum8 Type of the address: 0 – individual user (functional) address 1 – individual system address 2 – group user (functional) address 3 – group system address
Node or group U8 Address of the node (individual addressing) or address of the group (group addressing)
Function or station
U8 Address of the function (user addressing) or station (system addressing)
Next station U8 Address of the next station in case of bypassing function directory
Caller identification
Fct_id U8 Identification of the caller function
Topo_cnt U8 Topo_counter supplied by the application 0 – local communication within node
Reserved U16 Reserved
Fct_handle U32 Handle of the function returned by the registering caller function service
Sess_tmo U32 Timeout of the session in ms. The timeout is counted from the sending of call message until the reply message is received
User_ref U32 External user identification
Call_len U32 Length of the call message
Item Type
Length Meaning
Loading the call message
Inst_handle U32 Handle of the instance (returned in allocation of instance)
Message segment
Offset U32 Segment offset
Data_len U32 Length of the data in segment
Data ... Data of the segment
Reserved U8 Reserved (in case of odd length of the segment)
Item Type
Length Meaning
Storing the reply message
Inst_handle U32 Handle of the instance
Message segment identification
Offset U32 Segment offset
Data_len U32 Length of the data in segment
Item Type
Length Meaning
Destruction of the instance
Inst_handle U32 Handle of the instance
TCN-MVB-ACP
53/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
Get state of the instance
Inst_handle U32 Handle of the instance
Item Type
Length Meaning
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (min. 8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Writing control of the caller instance (0x91)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
Item Type
Length Meaning
Allocation of the new instance
Inst_handle U32 Handle of the allocated instance
Item Type
Length Meaning
Loading the call message
Rest_len U32 Length of the remaining part of the message to be load
Item Type
Length Meaning
Storing the reply message
Rest_len U32 Length of the remaining part of the message to be store
Data ... Data of the segment
Reserved U8 Reserved (in case of odd length of the segment)
Item Type
Length Meaning
Destruction of the instance – no response data
Item Type
Length Meaning
Get state of the instance
State Enum8 State of the instance: 0 – free 2 – call loading 3 – call ready 4 – calling 5 – call end 6 – reply storing 7 – end
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 54/71
Item Type Length
Meaning
Return code Enum8 Msg/AMI result code
Reserved U16 Reserved
Reply length U32 Length of the reply message
User ref U32 External user identification
Item Type
Length Meaning
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.3.11 Writing control of the replier instance
This service provides control of the replier instance. Using this service the user controls receiving the call message and sending the reply message. The state machine of the replier instance is as follows:
State Command or event Next state
Free Received the call Call received
Call received Storing the call message Call storing or Wait reply
Destruction of the instance Free
Call storing Storing the call message Call storing or Wait reply
Destruction of the instance Free
Wait reply Reply Reply loading or Reply ready
Destruction of the instance Free
Reply loading Loading the reply message Reply loading or Reply ready
Destruction of the instance Free
Reply ready No command or action Replying
Destruction of the instance Free
Replying Reply sent End
Destruction of the instance Free
End Destruction of the instance Free
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (min. 12 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing control of the replier instance (0x93)
Command U8 Command to control the replier instance: 1 – storing the call message 2 – reply 3 – loading the reply message 4 – destruction of the instance 5 – get state of the instance
Sequential number U8 Session sequential number
TCN-MVB-ACP
55/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
Storing the call message
Inst_handle U32 Handle of the instance
Message segment identification
Offset U32 Segment offset
Data_len U32 Length of the data in segment
Item Type Length
Meaning
Reply
Inst_handle U32 Handle of the instance
Reply_status U8 Result of processing transferred back to the caller
Reserved U8 Reserved
Reserved U16 Reserved
Reply_len U32 Length of the reply message
User_ref U32 External user identification
Item Type Length
Meaning
Loading the reply message
Inst_handle U32 Handle of the instance
Message segment
Offset U32 Segment offset
Data_len U32 Length of the data in segment
Data ... Data of the segment
Reserved U8 Reserved (in case of odd length of the segment)
Item Type Length
Meaning
Destruction of the instance
Inst_handle U32 Handle of the instance
Item Type Length
Meaning
Get state of the instance
Inst_handle U32 Handle of the instance
Item Type Length
Meaning
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (min. 8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Writing control of the replier instance (0x93)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 56/71
Item Type Length
Meaning
Storing the call message
Rest_len U32 Length of the remaining part of the message to be store
Data ... Data of the segment
Reserved U8 Reserved (in case of odd length of the segment)
Item Type
Length Meaning
Reply – no response data
Item Type
Length Meaning
Loading the reply message
Rest_len U32 Length of the remaining part of the message to be load
Item Type
Length Meaning
Destruction of the instance – no response data
Item Type
Length Meaning
Get state of the instance
State Enum8 State of the instance: 0 – free 1 – call received 2 – call storing 3 – wait reply 4 – reply loading 5 – reply ready 6 – replying 7 – end
Return code Enum8 Msg/AMI result code
Reserved U16 Reserved
Call length U32 Length of the call message
User ref U32 External user identification
Item Type
Length Meaning
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.4. Description of services for bus administration (class 3 and 4)
Recommended configuration steps for bus administrator configuration:
1) Writing configuration (service “C”) with Passive state.
2) Reading bus administrator status (service 0xA0).
3) Writing cancel bus admin. configuration (service 0xA3) if bus admin. is already configured from step 2).
TCN-MVB-ACP
57/71 tcn-mvb-acp_ms_en_118
4) Writing bus administrator configuration (service 0xA1). start configuration load cycles and splits (separately for each identification of cycle) load list of devices stop configuration
5) Writing configuration (service “C”) with Regular state
6) Writing start/stop bus administrator (service 0xA5) with command Start
Following services are available:
Service Code Chapter
Writing bus administrator configuration service 0xA1 3.4.1
Writing cancel bus administrator configuration service 0xA3 3.4.2
Writing start/stop bus administrator service 0xA5 3.4.3
Reading bus administrator status service 0xA0 3.4.4
Reading bus administrator statistics service 0xA2 3.4.5
Clearing bus administrator statistics service 0xA7 3.4.6
3.4.1 Writing bus administrator configuration service
Writing bus administrator configuration service provides configuration of MVB bus administrator parameters, periodic process data polling lists and list of known devices.
Common request format (request header) is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (min. 12 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing bus administrator configuration (0xA1)
Command U8 Command to setup bus administrator configuration: 1 – start configuration 2 – load cycle 3 – load split 4 – load list of known devices 6 – load list of devices for MD communication 5 – stop configuration
Sequential number U8 Session sequential number
Cmd_data ... See command data below
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Start configuration command sets up bus administrator parameters. This command can be called in passive states only (see chapter “3.2.1 Writing the configuration service”). This command should be called before other configuration commands.
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 58/71
Request format is as follows:
Item Type Length
Meaning
Start configuration
Dev_scan_strategy U8 Strategy of scanning devices: 1 – scan all devices 2 – scan known devices only
Event_poll_strategy U8 Strategy of polling events: 0 – no polling 1 – polling of high priority events only 2 – polling of low priority events only 3 – polling low and high priority events
Reply_tmo_max U8 Maximum expected reply delay between master and slave frame: 0 – default reply (42.7 μs) 1 – ¼ reply (10.7 μs) 2 – ½ reply (21.4 μs) 3 – ¾ reply (32 μs) 4 – default reply (42.7 μs) 5 – 1 ¼ reply (53.4 μs) 6 – 1 ½ reply (64 μs) 7 – 1 ¾ reply (74.7 μs) 8 – double reply (85.4 μs)
Reserved U8 Reserved
Basic_per_len U32 Basic period (BP) length [μs] (supported only 1000)
Per_phase_len U32 Maximum length of periodic and supervisor phase [μs]
Macro_per_len U32 Macro period length in number of BP [BP] (supported only 1024)
Turn_len U16 Number of macro period after which master offers mastership to the next bus administrator [macro_per] (not supported, should be set to 0)
Config_ver U16 Version number of the configuration as 16-bit number. Two least significant bits are copied to AX0 and AX1 in device status.
Load cycle command sets up list of master frames in given cycle (individual period). If list of master frames doesn’t fit into ACP frame this command should be called more times. This command should be called before Load split and Load list of known devices commands.
Request format is as follows:
Item Type Length
Meaning
Load cycle command
Nr_MF_total U16 Total number of master frames in given cycle
Period_id U8 Identification of cycle (individual period): 0 – cycle 1 1 – cycle 2 2 – cycle 4 3 – cycle 8 4 – cycle 16 5 – cycle 32 6 – cycle 64 7 – cycle 128
TCN-MVB-ACP
59/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
8 – cycle 256 9 – cycle 512 10 – cycle 1024
Nr_MF_set U8 Number of master frames in this set
List of master frames
MF_1 U16 1st master frame (fcode:4, port_addr:12)
MF_2 U16 2nd master frame (fcode:4, port_addr:12)
... ... ...
MF_n U16 Nth master frame (fcode:4, port_addr:12)
Load split command sets up split of master frames in given cycle (individual period) into basic periods. If split of cycle doesn’t fit into ACP frame this command should be called more times. This command should be called after Load cycle command (not for cycle 1 in which is no split) and before Load list of known devices commands.
Request format is as follows:
Item Type Length
Meaning
Load split command
Nr_split_total U16 Total number of splits in given cycle
Period_id U8 Identification of cycle (individual period): 1 – cycle 2 2 – cycle 4 3 – cycle 8 4 – cycle 16 5 – cycle 32 6 – cycle 64 7 – cycle 128 8 – cycle 256 9 – cycle 512 10 – cycle 1024
Nr_split_set U8 Number of splits
List of splits
Nr_MF_BP_1 U8 Number of master frames in 1st basic period
Nr_MF_BP_2 U8 Number of master frames in 2nd basic period
... ... ...
Nr_MF_BP_n U8 Number of master frames in Nth basic period
Load list of known devices command sets up list of known devices in case that scan known devices only strategy is used. If list of known devices doesn’t fit into ACP frame this command should be called more times. This command should be called after commands Load cycle and Load split.
Request format is as follows:
Item Type Length
Meaning
Load list of known devices
Nr_knw_devs_total U16 Total number of known devices
Reserved U8 Reserved
Nr_knw_devs_set U8 Number of known devices in this set
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 60/71
Item Type Length
Meaning
List of known devices
Dev_addr_1 U16 Device address of 1st device
Dev_addr_2 U16 Device address of 2nd device
... ... ...
Dev_addr_n U16 Device address of Nth device
Load list of devices for MD communication sets up list of devices which are polled for message data. If list of devices for MD communication doesn’t fit into ACP frame this command should be called more times. This command should be called after commands Load cycle, Load split and Load list of known devices. This command is supported only on bus administrator class 4.
Request format is as follows:
Item Type Length
Meaning
Load list of devices for MD communication
Nr_MD_devs_total U16 Total number of devices for MD communication
Reserved U8 Reserved
Nr_MD_devs_set U8 Number of devices for MD communication in this set
List of known devices
Dev_addr_1 U16 Device address of 1st device
Dev_addr_2 U16 Device address of 2nd device
... ... ...
Dev_addr_n U16 Device address of Nth device
Stop configuration command stops and stores loaded bus administrator configuration or interrupts current configuration. There is no parameters in this command:
Item Type Length
Meaning
Stop configuration – no parameters
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Writing bus administrator configuration (0xA1)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.4.2 Writing cancel bus administrator configuration service
Writing cancel bus administrator configuration service cancels previous configuration of bus administrator. After calling this service bus administrator can be reconfigured.
TCN-MVB-ACP
61/71 tcn-mvb-acp_ms_en_118
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing cancel bus administrator configuration service (0xA3)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Writing cancel bus administrator configuration service (0xA3)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.4.3 Writing start/stop bus administrator service
Writing start/stop bus administrator service provides starting/stopping of bus administrator on the MVB bus. The bus administrator should be started in MVB regular state (see chapter “3.2.1 Writing the configuration service”). The bus administrator should be stopped before reconfiguration.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Writing start/stop bus administrator service (0xA5)
Command U8 1 – start bus administrator service 2 – stop bus administrator service
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 62/71
Item Type Length
Meaning
Service Ch8 Writing start/stop bus administrator service (0xA5)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.4.4 Reading bus administrator status service
Reading bus administrator status service provides reading of SW version, operational status, status of configuration and master status of bus administrator.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading bus administrator status service (0xA0)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (48 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading bus administrator status service (0xA0)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
Name_ver String32 Name and version of MVB bus administrator library
Oper_state U8 Operational state of bus administrator: 0 – idle (library is not initialized) 1 – passive (bus administrator is switch off) 2 – regular (bus administrator is operational)
Config_state U8 Configuration state of bus administrator: 0 – undef (configuration is not defined) 1 – no (bus administrator is not configured) 2 – configuration of bus administrator in progress 3 – yes (bus administrator is configured)
Master_state U8 Master state: 0 – no master 1 – standby master 2 – regular master 3 – find next master 4 – interim master
Reserved U8 Reserved
Standby_tmo U32 Standby timeout
TCN-MVB-ACP
63/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
3.4.5 Reading bus administrator statistics service
Reading bus administrator statistics service provides reading of errors and others statistics counters.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Reading bus administrator statistics service (0xA2)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (76 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Reading bus administrator statistics service (0xA2)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
Cnt_err_tnr U32 Counter of table not ready error (no next MTD valid)
Cnt_err_tinv U32 Counter of table invalid (invalid MTD loaded)
Cnt_err_povf U32 Counter of periodic phase overflow
Cnt_err_mfnr U32 Counter of unreceived master frames from device itself
Cnt_err_sfre U32 Counter of fatal received errors (ESF, DSF)
Cnt_err_mrto U32 Counter of timeouts of master frames from device itself
Cnt_err_banp U32 Counter of requests for next MTD
Cnt_promoted U32 Counter of promotions from bus administrator to master
Cnt_demoted U32 Counter of demotions from master to bus administrator
Cnt_macro_per U32 Counter of macro periods
Cnt_mf_foreign U32 Counter of received MF from other masters
Cnt_mship_tx U32 Counter of mastership transmitted
Cnt_mship_rx U32 Counter of mastership received
Cnt_collisions U32 Counter of master collisions
Cnt_err_unfr U32 Counter of unexpected frame received
Cnt_err_bawe U32 Counter of internal errors covered by watchdog
Cnt_err_bapf U32 Counter of planning failures
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 64/71
3.4.6 Clearing bus administrator statistics service
Clearing bus administrator statistics service provides clearing of bus administrator statistics.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Clearing bus administrator statistics service (0xA7)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Clearing bus administrator statistics service (0xA7)
Status U8 Return code of processing state
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
TCN-MVB-ACP
65/71 tcn-mvb-acp_ms_en_118
3.5. The Description of services for module firmware updating
The firmware structure consists of three separate program modules. Program modules are as follow: loader, module application and MVB/Host Controller configuration.
Fig. 2 - Firmware components
Among above mentioned modules the station also contains “Safe application” and “Safe MVB/Host Controller” ensures ability to download new firmware in cases of several download failures which can result in the inability to run ordinary application (module firmware). Executing “Safe application” is called “Service Mode”. Download consist of the following steps: /* Download initialization */ Download status check (service “i”) if download_status not equal idle then
Download cancellation (service download control – “I”) end_if Download initialization (service download control – “I”) /* Send file header */ Download status check (service “i”) until download_status equal active do Firmware download (service “B”) Download status check (service “i”) end_until /* Error check */ if download_status equal idle then return(error) end_if /* Wait until old data is erased */ until download_status equal erasing do Wait(100 ms) Download status check (service “i”) end_until
MVB/Host Controller
(updatable)
Module Application (updatable)
Loader (fixed)
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 66/71
/* Error check */ if download_status equal idle then return(error) end_if /* Wait until the rest of file is downloaded */ until the whole data file is downloaded to the device do Firmware download (service “B”) end_until /* Activate the new data */ Download termination (service download control – “I”) Other auxiliary function can be used to verify the downloaded image, see Get information about firmware (service “f”).
Following services are available:
Service Code Chapter
Download control “I” 3.5.1
Download status check “I” 3.5.2
Firmware data download “B” 3.5.3
Get information about device “f” 3.5.4
3.5.1 Download control
This service provides initialization/termination/cancellation of download of firmware update.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (14 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Download control service (“I”)
Command Ch8 Module Application (“A”) MVB/Host Controller configuration (“F”)
Sequential number U8 Session sequential number
Total length U32 Total number of downloaded bytes
Request String2 Download initialization (“d”, “f”) Download termination (“e”, “f”) Download cancellation (“c”, “f”)
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Download control service (“I”)
Status U8 Return code of processing state (amit_mvb_ok or amit_mvb_dwm_err_XXX)
TCN-MVB-ACP
67/71 tcn-mvb-acp_ms_en_118
Item Type Length
Meaning
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Download initialization can take about several hundreds of milliseconds and during this process the module may not be able to respond.
Service is available only in passive state (see chapter “3.2.1 Writing the configuration service”).
It is recommended to check status od download by calling the service „Download status check“.
3.5.2 Download status check
This service returns the state of download and last result code for all domains.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Download initialization status check service (“i”)
Command U8 Not used (0x00)
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (28 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Download status check service (“i”)
Status U8 Return code of processing state (amit_mvb_ok or amit_mvb_dwm_err_XXX)
Sequential number U8 Session sequential number
Loader
Identification Ch8 Identification (“L”)
Reserved U8 Reserved
State U8 State of download 0 – download is not supported 1 – idle 2 – download is active 3 – erasing
Result U8 Last result code of download operation (amit_mvb_ok or amit_mvb_dwm_err_XXX)
Note:
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 68/71
Item Type Length
Meaning
Safe application
Identification Ch8 Identification (“S”)
Reserved U8 Reserved
State U8 State of download 0 – download is not supported 1 – idle 2 – download is active 3 – erasing
Result U8 Last result code of download operation (amit_mvb_ok or amit_mvb_dwm_err_XXX)
Application
Identification Ch8 Identification (“A”)
Reserved U8 Reserved
State U8 State of download 0 – download is not supported 1 – idle 2 – download is active 3 – erasing
Result U8 Last result code of download operation (amit_mvb_ok or amit_mvb_dwm_err_XXX)
MVB/Host Controller configuration
Identification Ch8 Identification (“F”)
Reserved U8 Reserved
State U8 State of download 0 – download is not supported 1 – idle 2 – download is active 3 – erasing
Result U8 Last result code of download operation (amit_mvb_ok or amit_mvb_dwm_err_XXX)
Safe MVB/Host Controller configuration
Identification Ch8 Identification (“E”)
Reserved U8 Reserved
State U8 State of download 0 – download is not supported 1 – idle 2 – download is active 3 – erasing
Result U8 Last result code of download operation (amit_mvb_ok or amit_mvb_dwm_err_XXX)
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Service is available only in passive state (see chapter “3.2.1 Writing the configuration service”).
Note:
TCN-MVB-ACP
69/71 tcn-mvb-acp_ms_en_118
3.5.3 Firmware data download
This service is used to download data of the new firmware to the device. The download should be initialized first using the Download control service.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (12 to 508 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Firmware data download (“B”)
Command Ch8 Module Application (“A”) MVB/Host Controller configuration (“F”)
Sequential number U8 Session sequential number
Data length U16 Length of data in the segment (max. 498 bytes)
Data … Firmware binary data (aligned to words)
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Firmware data download (“B”)
Status U8 Return code of processing state (amit_mvb_ok or amit_mvb_dwm_err_XXX)
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
It is necessary to send the firmware file sequentially, from the file beginning. The data of the download segment should be aligned to words. If a loading failure occurs, the loading process is to be re-initialized using the download control service. After downloading the whole file the download should be finished using download control service.
Service is available only in passive state (see chapter “3.2.1 Writing the configuration service”).
3.5.4 Get information about device
This service returns information about firmwares currently running on station and version numbers and checksums of all firmwares which are present on station.
Request format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (8 bytes)
Request type Ch8 Request (“c”)
Service Ch8 Get information about firmware/configuration (“f”)
Note:
TCN-MVB-ACP
tcn-mvb-acp_ms_en_118 70/71
Item Type Length
Meaning
Command U8 0x00 – get information about firmware 0x01 – get information about device configuration
Sequential number U8 Session sequential number
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
In case of command 0x00 (get information about firmware), response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (52 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Get information about firmware/configuration (“f”)
Status U8 Return code (amit_mvb_ok or amit_mvb_dwm_err_XXX)
Sequential number U8 Session sequential number
Running firmware String2 Loader/Service mode (“L”, “D”) Application (“A”, “P”)
Reserve U16 0
Loader
Version major U8 Version major
Version minor U8 Version minor
Revision U16 Revision
CRC U32 Image checksum
Safe application
Version major U8 Version major
Version minor U8 Version minor
Revision U16 Revision
CRC U32 Image checksum
Application
Version major U8 Version major
Version minor U8 Version minor
Revision U16 Revision
CRC U32 Image checksum
MVB/Host Controller configuration
Version major U8 Version major
Version minor U8 Version minor
Revision U16 Revision
CRC U32 Image checksum
Safe MVB/Host Controller configuration
Version major U8 Version major
Version minor U8 Version minor
Revision U16 Revision
CRC U32 Image checksum
CRC U16 16-bit CRC of frame contents
DLE ETX String2 End Of Frame (0x10, 0x03)
Version 0.0.0 is returned in case of invalid (unreadable) image firmware/configuration.
Note:
TCN-MVB-ACP
71/71 tcn-mvb-acp_ms_en_118
In case of command 0x01(get information about device configuration), response format is as follows:
Item Type Length
Meaning
DLE STX String2 Start Of Frame (0x10, 0x02)
Length U16 Frame length (92 bytes)
Request type Ch8 Response (“r”)
Service Ch8 Get information about firmware/configuration (“f”)
Status U8 Return code (amit_mvb_ok or amit_mvb_dwm_err_XXX)
Sequential number
U8 Session sequential number
DEV_STATUS U8 0x00 – operational (application and MVB/Host controller)
0x01 – invalid operational mode: application executed but safe MVB/Host controller running
0x02 – service mode (safe application and safe MVB/Host controller)
0x03 – invalid service mode: safe application executed but MVB/Host controller running
0x04 – invalid operational mode: application executed but neither MVB/Host controller nor safe MVB/Host controller running
0x06 – invalid service mode: safe application executed but neither MVB/Host controller nor safe MVB/Host controller running
Reserve U8 0
Reserve U16 0
HWID U16 Hardware identifier
PID U16 Process identifier
CFGID U32 Hardware configuration identifier
S/N String8 Serial number
HWSTRG String32 Device name
CFGSTR String32 Configuration desription
3.6. Encoding of data types
Next data types are used in ACP protocol:
Data type Length Meaning
Ch8 8 bits Character; no endian ordering
U x x bits Unsigned number; little endian ordering (for multi bytes numbers)
I x x bits Signed number; little endian ordering (for multi bytes numbers)
String n n bytes Array of characters with length n; no endian ordering. The string is NULL terminated only if it is specified in the service.
<Primitive Type> [n] n * length of primitive type
Array of primitive types; endian ordering is relative to primitive type only