toyer
Profesyonel Üye
- Katılım
- 7 Kas 2008
- Mesajlar
- 1,249
- Puanları
- 306
Read Coil Status (FC=01)
Request
This command is requesting the ON/OFF status of discrete coils # 20 to 56
from the slave device with address 17.
11 01 0013 0025 0E84
11: The Slave Address (17 = 11 hex)
01: The Function Code (read Coil Status)
0013: The Data Address of the first coil to read. (Coil 20 - 1 = 19 = 13 hex)
0025: The total number of coils requested. (coils 20 to 56 = 37 = 25 hex)
0E84: The CRC (cyclic redundancy check) for error checking.
Response
11 01 05 CD6BB20E1B 45E6
11: The Slave Address (17 = 11 hex)
01: The Function Code (read Coil Status)
05: The number of data bytes to follow (37 Coils / 8 bits per byte = 5 bytes)
CD: Coils 27 - 20 (1100 1101)
6B: Coils 35 - 28 (0110 1011)
B2: Coils 43 - 36 (1011 0010)
0E: Coils 51 - 44 (0000 1110)
1B: 3 space holders & Coils 56 - 52 (0001 1011)
45E6: The CRC (cyclic redundancy check).
Modbusta neden farklı farklı functionlar var? neden basitcene sadece okuma ve yazma diye ikiye ayırmamıslarda coil , register dır ayırmıslar.
mesela yukarıda ki örnekte neden su adresteki cihazdan su adresten baslayarak şu kadar byte oku (5 byte) diye komut gönderilmiyorda. bunun yerine su adresteki cihazdan su adresten baslayarak 36 coil oku(5 byte) diye komut gonderiliyor.
yani neden coil oku diye ayrım var?
Request
This command is requesting the ON/OFF status of discrete coils # 20 to 56
from the slave device with address 17.
11 01 0013 0025 0E84
11: The Slave Address (17 = 11 hex)
01: The Function Code (read Coil Status)
0013: The Data Address of the first coil to read. (Coil 20 - 1 = 19 = 13 hex)
0025: The total number of coils requested. (coils 20 to 56 = 37 = 25 hex)
0E84: The CRC (cyclic redundancy check) for error checking.
Response
11 01 05 CD6BB20E1B 45E6
11: The Slave Address (17 = 11 hex)
01: The Function Code (read Coil Status)
05: The number of data bytes to follow (37 Coils / 8 bits per byte = 5 bytes)
CD: Coils 27 - 20 (1100 1101)
6B: Coils 35 - 28 (0110 1011)
B2: Coils 43 - 36 (1011 0010)
0E: Coils 51 - 44 (0000 1110)
1B: 3 space holders & Coils 56 - 52 (0001 1011)
45E6: The CRC (cyclic redundancy check).
Modbusta neden farklı farklı functionlar var? neden basitcene sadece okuma ve yazma diye ikiye ayırmamıslarda coil , register dır ayırmıslar.
mesela yukarıda ki örnekte neden su adresteki cihazdan su adresten baslayarak şu kadar byte oku (5 byte) diye komut gönderilmiyorda. bunun yerine su adresteki cihazdan su adresten baslayarak 36 coil oku(5 byte) diye komut gonderiliyor.
yani neden coil oku diye ayrım var?