Bootstrak Skip to main content

6. MODBUS Interface – Special Registers

Streszczenie: Protokół MODBUS w NA-9473, część 2: rejestry specjalne – identyfikacja adaptera (Vendor ID, kod produktu, firmware), czasy watchdog i opóźnienia, informacje o adapterze (adres, obrazy procesu, tryby obrazu, listy slotów), informacje o slotach rozszerzeń (adresy dla 12 slotów, struktura rejestrów) i format kodu danych I/O; odnośniki do dokumentów MODBUS.
EN: MODBUS interface, part 2: special registers – adapter identification, watchdog/time, adapter information, expansion slot information and IO data code format.

Dotyczy: adapter sieciowy CREVIS NA-9473 (MODBUS RTU/ASCII, RS-485) systemu FnIO z modułami rozszerzeń serii ST
Źródło: dokumentacja producenta (CREVIS NA-9473 MODBUS Adapter (RS-485) User Manual); tabele przepisane z obrazów na tekst – opracowanie Multiprojekt

Rozdział 6 „MODBUS Interface” podzielono na 2 strony: Transmission Modes and Function Codes · Special Registers.

6.3 MODBUS Special Register Map

The special register map can be accessed by function code 3, 4, 6 and 16. Also the special register map must be accessed by read/write of every each address (one address).

6.3.1 Adapter Identification Special Register (0x1000, 4096)

Adapter Identification special registers (0x1000, 4096)

AddressAccessType, SizeDescription
0x1000 (4096)Read1 wordVendor ID = 0x02E5 (741), Crevis Co., Ltd.
0x1001 (4097)Read1 wordDevice type = 0x000C, Network Adapter
0x1002 (4098)Read1 wordProduct code: 0x0300 (NA-9171, MODBUS/RS-232), 0x0301 (NA-9173, MODBUS/RS-485), 0x1301 (NA-9473, MODBUS/RS-485)
0x1003 (4099)Read1 wordFirmware revision, e.g. 0x0101 = revision 1.01
0x1004 (4100)Read2 wordsProduct unique serial number
0x1005 (4101)ReadString up to 34 bytesProduct name string. First 1 word is length of valid character string. Example response: valid character size = 0x0015 = 21 characters, “NA9473_MODBUS_Adapter”.
0x1006 (4102)Read1 wordSum check of EEPROM
0x1010 (4112)Read2 wordsFirmware release date
0x1011 (4113)Read2 wordsProduct manufacturing inspection date
0x1012 (4114)ReadString up to 34 bytesVendor name string. First 1 word is length of valid character string.
0x101E (4126)Read7 wordsComposite ID of the following addresses: 0x1100 (4352) rotary switch value, slave node ID (1 word); 0x1000 (4096) vendor ID (1 word); 0x1001 (4097) device type (1 word); 0x1002 (4098) product code (1 word); 0x1003 (4099) firmware revision (1 word); 0x1004 (4100) product serial number (2 words).

* String type consists of valid string length (first 1 word) and array of characters.

6.3.2 Adapter Watchdog Time, other Time Special Register (0x1020, 4128)

A watchdog timer can be configured for timeout periods up to 65535(1unit=100msec). The Watchdog timer will timeout (timer decreased, reached 0) if MODBUS operation to the slave node does not occur over the configured watchdog value, then the slave adapter forces that slot output value is automatically set to user-configured fault actions and values.

Adapter Watchdog Time and other time special registers (0x1020, 4128)

AddressAccessType, SizeDescription
0x1020 (4128)Read/Write1 wordWatchdog time value, 16-bit unsigned. The time value is represented by multiples of 100 ms. The default value is 50 (50 × 100 ms = 5 s). A change of the watchdog time value resets the watchdog error.
0x1021 (4129)Read1 wordWatchdog time remain value. This value decreases every 100 ms.
0x1022 (4130)Read1 wordWatchdog error counter; it is cleared by writing address 0x1020.
0x1023 (4131)Read/Write1 wordEnable/disable auto recovery of watchdog error when receiving a new frame. 0: Disable, 1: Enable (default). Its value is stored in EEPROM.
0x1024 (4132)Read/Write1 wordTransmission response delay time. The value can be set 16-bit unsigned (1 ms unit). The default value is 0 (no delay).
0x1025 (4133)Read/Write1 wordValid byte-to-byte time gap in ASCII mode (1 ms unit). In ASCII mode, if the byte-to-byte time gap is over the setting value during receiving a frame, this frame will be cancelled (dropped).
0x1028 (4136)Read2 wordsIO update time, main loop time (100 µs unit).

6.3.3 Adapter Information Special Register (0x1100, 4352)

Adapter Information special registers (0x1100, 4352)

AddressAccessType, SizeDescription
0x1100 (4352)Read/Write1 wordHigh byte is DIP (SW1) switch value; low byte is current slave node address (MODBUS slave node address). If DIP (SW1) switches value is 0, the slave node address is assigned with the last valid address and can be changed by software (1~15).
0x1101 (4353)Read1 wordHigh byte is current DIP (SW2) switch value; low byte is the currently used setup value.
0x1102 (4354)Read1 wordStart address of input image word register = 0x0000
0x1103 (4355)Read1 wordStart address of output image word register = 0x0800
0x1104 (4356)Read1 wordSize of input image word register
0x1105 (4357)Read1 wordSize of output image word register
0x1106 (4358)Read1 wordStart address of input image bit = 0x0000
0x1107 (4359)Read1 wordStart address of output image bit = 0x1000
0x1108 (4360)Read1 wordSize of input image bit
0x1109 (4361)Read1 wordSize of output image bit
0x110E (4366)Readup to 33 wordsExpansion slot’s ST-number including NA. First 1 word is adapter’s number; for NA-9473 it is 0x9473.
0x1110 (4368)Read1 wordNumber of expansion slots
0x1111 (4369)Read1 wordNumber of active slots
0x1112 (4370)Read1 wordNumber of inactive slots
0x1113 (4371)Readup to 33 wordsExpansion slot module ID. Refer to Appendix A.1 Product List. First 1 word is adapter’s module ID.
0x1114 (4372) *Read/Write1 wordInput process image mode. The default value is 2. Valid value range is from 0 to 3. Refer to 5.3.1.
0x1115 (4373) *Read/Write1 wordOutput process image mode. The default value is 0. Valid value range is from 0 to 1. Refer to 5.3.2.
0x1116 (4374) **Read/Write2 wordsInactive slot list; the corresponding bit represents slot position. 0: active slot, 1: inactive slot. Example: if value is 0x0001, 0x8000, then slot #1 and #32 are inactive slots.
0x1117 (4375)Read2 wordsLive slot list; the corresponding bit represents slot position. 1: live slot, 0: not live slot.
0x1118 (4376)Read2 wordsAlarm slot list; the corresponding bit represents slot position. 1: alarm slot, 0: normal slot.
0x1119 (4377)Read1 wordHigh byte is MODBUS status, low byte is FnBus status. Refer to 5.3.1.
0x111A (4378)Write1 wordReserved. Adapter scan command.
0x111B (4379)Read/Write1 wordReserved. IO state machine.
0x111C (4380)Read2 wordsReserved. Runtime fault code.
0x111D (4381)Read1 wordAdapter FnBus revision. If 0x013C, FnBus revision is 1.60.
0x111E (4382)Read1 wordReserved. Adapter IO identification vendor code.

Uwaga Multiprojekt: przypisy oznaczone * i ** są w obrazie źródłowym ucięte i nieczytelne. W analogicznej tabeli 6.3.4 przypis * brzmi: „After the system is reset, the new Set Value action is applied” – w razie wątpliwości sprawdź oryginalny PDF producenta.

6.3.4 Expansion Slot Information Special Register (0x2000, 8192)

Each expansion slot has 0x20(32) address offset and same information structure.

  • Slot#1 0x2000(8192) ~0x201F (8223)
  • Slot#2 0x2020(8224) ~0x203F (8255)
  • Slot#3 0x2040(8256) ~0x205F (8287)
  • Slot#4 0x2060(8288) ~0x207F (8319)
  • Slot#5 0x2080(8320) ~0x209F (8351)
  • Slot#6 0x20A0 (8352) ~0x20BF (8383)
  • Slot#7 0x20C0 (8384) ~0x20DF (8415)
  • Slot#8 0x20E0 (8416) ~0x20FF (8447)
  • Slot#9 0x2100(8448) ~0x211F (8479)
  • Slot#10 0x2120(8480) ~0x213F (8511)
  • Slot#11 0x2140(8512) ~0x215F (8543)
  • Slot#12 0x2160(8544) ~0x217F (8575)

Address = 0x2000 + (slot number − 1) × 0x20 + offset. Full table for all 12 slots (the original shows slots #1–#3 and #11–#12):

Expansion slot special register addresses

Address OffsetSlot #1Slot #2Slot #3Slot #4Slot #5Slot #6Slot #7Slot #8Slot #9Slot #10Slot #11Slot #12
+0x00 (+0)0x2000 (8192)0x2020 (8224)0x2040 (8256)0x2060 (8288)0x2080 (8320)0x20A0 (8352)0x20C0 (8384)0x20E0 (8416)0x2100 (8448)0x2120 (8480)0x2140 (8512)0x2160 (8544)
+0x01 (+1)0x2001 (8193)0x2021 (8225)0x2041 (8257)0x2061 (8289)0x2081 (8321)0x20A1 (8353)0x20C1 (8385)0x20E1 (8417)0x2101 (8449)0x2121 (8481)0x2141 (8513)0x2161 (8545)
+0x02 (+2)0x2002 (8194)0x2022 (8226)0x2042 (8258)0x2062 (8290)0x2082 (8322)0x20A2 (8354)0x20C2 (8386)0x20E2 (8418)0x2102 (8450)0x2122 (8482)0x2142 (8514)0x2162 (8546)
+0x03 (+3)0x2003 (8195)0x2023 (8227)0x2043 (8259)0x2063 (8291)0x2083 (8323)0x20A3 (8355)0x20C3 (8387)0x20E3 (8419)0x2103 (8451)0x2123 (8483)0x2143 (8515)0x2163 (8547)
+0x04 (+4)0x2004 (8196)0x2024 (8228)0x2044 (8260)0x2064 (8292)0x2084 (8324)0x20A4 (8356)0x20C4 (8388)0x20E4 (8420)0x2104 (8452)0x2124 (8484)0x2144 (8516)0x2164 (8548)
+0x05 (+5)0x2005 (8197)0x2025 (8229)0x2045 (8261)0x2065 (8293)0x2085 (8325)0x20A5 (8357)0x20C5 (8389)0x20E5 (8421)0x2105 (8453)0x2125 (8485)0x2145 (8517)0x2165 (8549)
+0x06 (+6)0x2006 (8198)0x2026 (8230)0x2046 (8262)0x2066 (8294)0x2086 (8326)0x20A6 (8358)0x20C6 (8390)0x20E6 (8422)0x2106 (8454)0x2126 (8486)0x2146 (8518)0x2166 (8550)
+0x07 (+7)0x2007 (8199)0x2027 (8231)0x2047 (8263)0x2067 (8295)0x2087 (8327)0x20A7 (8359)0x20C7 (8391)0x20E7 (8423)0x2107 (8455)0x2127 (8487)0x2147 (8519)0x2167 (8551)
+0x08 (+8)0x2008 (8200)0x2028 (8232)0x2048 (8264)0x2068 (8296)0x2088 (8328)0x20A8 (8360)0x20C8 (8392)0x20E8 (8424)0x2108 (8456)0x2128 (8488)0x2148 (8520)0x2168 (8552)
+0x09 (+9)0x2009 (8201)0x2029 (8233)0x2049 (8265)0x2069 (8297)0x2089 (8329)0x20A9 (8361)0x20C9 (8393)0x20E9 (8425)0x2109 (8457)0x2129 (8489)0x2149 (8521)0x2169 (8553)
+0x0A (+10)0x200A (8202)0x202A (8234)0x204A (8266)0x206A (8298)0x208A (8330)0x20AA (8362)0x20CA (8394)0x20EA (8426)0x210A (8458)0x212A (8490)0x214A (8522)0x216A (8554)
+0x0B (+11)0x200B (8203)0x202B (8235)0x204B (8267)0x206B (8299)0x208B (8331)0x20AB (8363)0x20CB (8395)0x20EB (8427)0x210B (8459)0x212B (8491)0x214B (8523)0x216B (8555)
+0x0C (+12)0x200C (8204)0x202C (8236)0x204C (8268)0x206C (8300)0x208C (8332)0x20AC (8364)0x20CC (8396)0x20EC (8428)0x210C (8460)0x212C (8492)0x214C (8524)0x216C (8556)
+0x0D (+13)0x200D (8205)0x202D (8237)0x204D (8269)0x206D (8301)0x208D (8333)0x20AD (8365)0x20CD (8397)0x20ED (8429)0x210D (8461)0x212D (8493)0x214D (8525)0x216D (8557)
+0x0E (+14)0x200E (8206)0x202E (8238)0x204E (8270)0x206E (8302)0x208E (8334)0x20AE (8366)0x20CE (8398)0x20EE (8430)0x210E (8462)0x212E (8494)0x214E (8526)0x216E (8558)
+0x0F (+15)0x200F (8207)0x202F (8239)0x204F (8271)0x206F (8303)0x208F (8335)0x20AF (8367)0x20CF (8399)0x20EF (8431)0x210F (8463)0x212F (8495)0x214F (8527)0x216F (8559)
+0x10 (+16)0x2010 (8208)0x2030 (8240)0x2050 (8272)0x2070 (8304)0x2090 (8336)0x20B0 (8368)0x20D0 (8400)0x20F0 (8432)0x2110 (8464)0x2130 (8496)0x2150 (8528)0x2170 (8560)
+0x11 (+17)0x2011 (8209)0x2031 (8241)0x2051 (8273)0x2071 (8305)0x2091 (8337)0x20B1 (8369)0x20D1 (8401)0x20F1 (8433)0x2111 (8465)0x2131 (8497)0x2151 (8529)0x2171 (8561)
+0x12 (+18)0x2012 (8210)0x2032 (8242)0x2052 (8274)0x2072 (8306)0x2092 (8338)0x20B2 (8370)0x20D2 (8402)0x20F2 (8434)0x2112 (8466)0x2132 (8498)0x2152 (8530)0x2172 (8562)
+0x13 (+19)0x2013 (8211)0x2033 (8243)0x2053 (8275)0x2073 (8307)0x2093 (8339)0x20B3 (8371)0x20D3 (8403)0x20F3 (8435)0x2113 (8467)0x2133 (8499)0x2153 (8531)0x2173 (8563)
+0x14 (+20)0x2014 (8212)0x2034 (8244)0x2054 (8276)0x2074 (8308)0x2094 (8340)0x20B4 (8372)0x20D4 (8404)0x20F4 (8436)0x2114 (8468)0x2134 (8500)0x2154 (8532)0x2174 (8564)
+0x15 (+21)0x2015 (8213)0x2035 (8245)0x2055 (8277)0x2075 (8309)0x2095 (8341)0x20B5 (8373)0x20D5 (8405)0x20F5 (8437)0x2115 (8469)0x2135 (8501)0x2155 (8533)0x2175 (8565)
+0x16 (+22)0x2016 (8214)0x2036 (8246)0x2056 (8278)0x2076 (8310)0x2096 (8342)0x20B6 (8374)0x20D6 (8406)0x20F6 (8438)0x2116 (8470)0x2136 (8502)0x2156 (8534)0x2176 (8566)
+0x17 (+23)0x2017 (8215)0x2037 (8247)0x2057 (8279)0x2077 (8311)0x2097 (8343)0x20B7 (8375)0x20D7 (8407)0x20F7 (8439)0x2117 (8471)0x2137 (8503)0x2157 (8535)0x2177 (8567)
+0x18 (+24)0x2018 (8216)0x2038 (8248)0x2058 (8280)0x2078 (8312)0x2098 (8344)0x20B8 (8376)0x20D8 (8408)0x20F8 (8440)0x2118 (8472)0x2138 (8504)0x2158 (8536)0x2178 (8568)
+0x19 (+25)0x2019 (8217)0x2039 (8249)0x2059 (8281)0x2079 (8313)0x2099 (8345)0x20B9 (8377)0x20D9 (8409)0x20F9 (8441)0x2119 (8473)0x2139 (8505)0x2159 (8537)0x2179 (8569)
+0x1A (+26)0x201A (8218)0x203A (8250)0x205A (8282)0x207A (8314)0x209A (8346)0x20BA (8378)0x20DA (8410)0x20FA (8442)0x211A (8474)0x213A (8506)0x215A (8538)0x217A (8570)
+0x1B (+27)0x201B (8219)0x203B (8251)0x205B (8283)0x207B (8315)0x209B (8347)0x20BB (8379)0x20DB (8411)0x20FB (8443)0x211B (8475)0x213B (8507)0x215B (8539)0x217B (8571)
+0x1C (+28)0x201C (8220)0x203C (8252)0x205C (8284)0x207C (8316)0x209C (8348)0x20BC (8380)0x20DC (8412)0x20FC (8444)0x211C (8476)0x213C (8508)0x215C (8540)0x217C (8572)
+0x1D (+29)0x201D (8221)0x203D (8253)0x205D (8285)0x207D (8317)0x209D (8349)0x20BD (8381)0x20DD (8413)0x20FD (8445)0x211D (8477)0x213D (8509)0x215D (8541)0x217D (8573)
+0x1E (+30)0x201E (8222)0x203E (8254)0x205E (8286)0x207E (8318)0x209E (8350)0x20BE (8382)0x20DE (8414)0x20FE (8446)0x211E (8478)0x213E (8510)0x215E (8542)0x217E (8574)
+0x1F (+31)0x201F (8223)0x203F (8255)0x205F (8287)0x207F (8319)0x209F (8351)0x20BF (8383)0x20DF (8415)0x20FF (8447)0x211F (8479)0x213F (8511)0x215F (8543)0x217F (8575)

Expansion slot information special registers – structure per slot (offset from slot base address)

AddressAccessType, SizeDescription
+0x00 (+0)Read1 wordSlot module ID. Refer to Appendix A.1 Product List.
+0x01 (+1)Read1 wordExpansion slot IO code. Refer to table IO Data Code Format.
+0x02 (+2) **Read1 wordInput start register address of input image word this slot.
+0x03 (+3) **Read1 wordInput word’s bit offset of input image word this slot.
+0x04 (+4) **Read1 wordOutput start register address of output image word this slot.
+0x05 (+5) **Read1 wordOutput word’s bit offset of output image word this slot.
+0x06 (+6) **Read1 wordInput bit start address of input image bit this slot.
+0x07 (+7) **Read1 wordOutput bit start address of output image bit this slot.
+0x08 (+8) **Read1 wordSize of input bit this slot.
+0x09 (+9) **Read1 wordSize of output bit this slot.
+0x0A (+10) **Readn wordsRead input data this slot.
+0x0B (+11) **Read/Writen wordsRead/write output data this slot.
+0x0C (+12) *Read/Write1 wordInactive slot: 0x0000 – active, 0x0001 – inactive.
+0x0E (+14)Read1 wordST-number; for ST-1324 returns 0x1324.
+0x0F (+15)ReadString up to 74 wordsFirst 1 word is length of valid character string. For ST-1324 returns “00 21 53 54 2D 31 33 32 34 2C 20 46 6E 49 4F 20 34 20 53 6F 75 72 63 69 6E 67 20 49 6E 20 34 38 56 64 63 00” – valid character size = 0x0021 = 33 characters, “ST-1324, FnIO 4 Sourcing In 48Vdc”.
+0x10 (+16)Read1 wordSize of configuration parameter byte.
+0x11 (+17) **Read/Writen wordsRead/write configuration parameter data, up to 8 bytes. Refer to document FnIO_Configuration_Parameter_Memory_Register ***.
+0x12 (+18)Read1 wordSize of memory byte.
+0x13 (+19) **Read/Writen wordsRead/write memory data. Offset of memory is fixed with 0.
+0x14 (+20) **Read/Writen wordsRead/write memory data. First 2 bytes of write data is memory offset.
+0x15 (+21)Read2 wordsProduct code. Refer to Appendix A.1 Product List.
+0x16 (+22)Read2 wordsCatalog number. Refer to Appendix A.1 Product List.
+0x17 (+23)Read1 wordFirmware revision.
+0x18 (+24)Read1 wordFnBus revision.
+0x1A (+26)Read/Writen wordsReserved. Read/write expansion class access.
+0x1B (+27)Read/Writen wordsReserved. Read/write maintenance data access.
  • * After the system is reset, the new “Set Value” action is applied.
  • ** Nothing of output, input, and memory or configuration parameter corresponding slot returns Exception 02.
  • *** Slot configuration parameter saved by internal EEPROM during power cycle until slot position changed.
  • *** All of output modules and special modules have the slot configuration parameter data. Refer to document FnIO_Configuration_Parameter_Memory_Register.

IO Data Code Format (1 word)

Bits #15–#8 = Output IO code (#15–#14 data type, #13–#8 data length); bits #7–#0 = Input IO code (#7–#6 data type, #5–#0 data length).

IO Data Code Format (1 word) – examples

ModuleOutput data type (#15–#14)Output data length (#13–#8)Input data type (#7–#6)Input data length (#5–#0)Word
ST-321400000000100001000x0084
ST-122400000000110001000x00C4
ST-122800000000010000010x0041
ST-412310000010000000000x8200
ST-221F01000010000000000x4200
ST-232411000100110001000xC4C4

Uwaga Multiprojekt: w oryginale w wierszu ST-221F jedynka stoi w bicie #8, ale podana wartość słowa 0x4200 (16 wyjść = 2 bajty) odpowiada bitowi #9 – tabelę zapisano zgodnie z wartością słowa.

Input/output Data Type

  • 0 0: No I/O Data
  • 0 1: Byte Data
  • 1 0: Word Data
  • 1 1: Bit Data

Input/output Data Length

  • 0 0 0 0 0 0 0: 0 Bit/Byte/Word
  • 0 0 0 0 0 0 1: 1 Bit/Byte/Word
  • 0 0 0 0 0 1 0: 2 Bit/Byte/Word
  • 0 0 0 0 0 1 1: 3 Bit/Byte/Word
  • ……
  • 1 1 1 1 1 1 1: 63 Bit/Byte/Word

6.4 MODBUS Reference

Słowa kluczowe

rejestry specjalne, Vendor ID, product code, watchdog, 0x1000, 0x1020, 0x1100, 0x2000, slot rozszerzeń, process image mode, IO data code, ST-number