![TREBING + HIMSTEDT SPI 3 Скачать руководство пользователя страница 22](http://html1.mh-extra.com/html/trebing-himstedt/spi-3/spi-3_manual_1154873022.webp)
Using data channel with »MODBUS_ Kanal« module and FB 127
22
Trebing & Himstedt | SPI 3 | MODBUS RTU
Parameters for user data:
specify where received telegrams can be saved and where telegrams to be sent can
be read
Parameters for return codes:
contain information on general status or processing results of the FB; also used to
transfer commands (e.g. reset) to the FB.
ANZW is used to display information on the status of the currently executing data
transfer operation.
ANZW consists of 16 bits as follows:
Bit 0 = 1
Operation is executing
Bit 1 = 1
Operation completed without errors
Bit 2 = 1
Operation completed with errors
Bit 4 = 1
Reset the operation
Set bit 4 to 1 to reset the operation. Bit 4 is reset to 0 by the FB when
the operation has been reset.
Bit 8…15
Error code (0x01 to 0x08 correspond to the MODBUS exception codes)
0x01
Invalid MODBUS function
0x02
Invalid MODBUS address
0x03
Invalid MODBUS data value
0x04
Slave device faulty
0x05
Acknowlegde, slave cannot process data immediately
0x06
Slave busy, repeat service later
0x07
Negative MODBUS receipt
0x08
Memory parity error
0xFF Timeout, slave did not respond within timeout range
Bit 3, 5…7
Internal use by the FB, do not change
Name
Type
Description / Function
Slave
Byte
Slave address for MODBUS service (MODBUS-Slave-Adresse)
Funktion
Byte
MODBUS function
Adresse
Word
Start address of data area in MODBUS slave
Anzahl
Word
Length of user data in bits (function 1, 2, 15) or words (function 3, 4, 16)
Data
Pointer
DB with user data for sending or receiving, e.g. P#M30.0, P#DB40.DBX0.0
Name
Type
Description / Function
TimeOUT
Word
Timeout – value is decremented with each call; example: cycle time
SPS = 30 ms; TIME = 17 -> Timeout 30 ms × 17 = 510 ms
(must be larger than the gateway
t
imeout)
ANZW
Word
Display word for data transfer status