MODBUS 657 example

https//www.racom.eu/eng/support/protocols_docum/bc262a_modex.html
TRANSPARENT MODE 
- Radioslave - Radiomaster communication example.

     Radioslave \|/  ....... \|/  Radiomaster
                 |            |
S00 - 691122FF -RFC          RFC- 69112205 - SCC0 

      SPe0t                       SPe0t
      (m)RS   (t)ON               (m)RM    (t)ON
      (S)(a)FF                    (M)(f)691122FF
      (T)(a)OFF                      (0)5
         (f)ON                       (p)200*10
         (d)OFF                      (t)200*100
         (C)ON                    (T)(a)ON
                                  (f)ON
                                  (d)ON
                                  (C)ON

The data 0503AAAA is sent from the Radioslave to the address 69112205 with the
 "its" function. The data fulfils the conditions for checking of the function
 number and the address. The Radiomaster's protocol has switched on the "CRC (a)
uto" function and so appends CRC:
>>
Monitoring: source 691122FF|5.
09:44:36.877|69112205 691122FF|69112205 691122FF|R01I    IN    4N09 2dat
0503 AAAA
Monitoring: source 69112205|5.
09:44:03.497|                 |00000005 000000FF|S00I    IN    4|09 2user 
0503 AAAA
09:44:04.044 tx      6 | S00
0503 AAAA 0E37

Now switch off the "CRC (a)uto" function in the Radiomaster. Send the data 0503
 AAAA 0E37 from the Radioslave with the "in" function. Then put the reply in the
 Radiomaster with the "in" function no later than the timeout "SPe0tMt":
>>
Monitoring: source 691122FF|1.
09:51:20.837 rxsim   6 | S00
0503 AAAA 0E37
09:51:20.852|69112205 691122FF|69112205 691122FF|R01I    IN    6N89 0dat
0503 AAAA 0E37
Monitoring: source 69112205|4.
09:50:47.517|                 |00000005 000000FF|S00I    IN    6|89 0user 
0503 AAAA 0E37
09:50:49.266 tx      6 | S00
0503 AAAA 0E37

09:50:52.929 rxsim   6 | S00
0503 AAAA 0E37
09:50:52.944|                 |000000FF 00000005|S00I   OUT    6| 89 0user 
0503 AAAA 0E37
Monitoring: source 691122FF|2.
09:51:28.272|691122FF 69112205|691122FF 69112205|R01I   OUT    6nC9r2dat
0503 AAAA 0E37
09:51:28.273 tx      6 | S00
0503 AAAA 0E37

The data which fits the conditions of the function, address and CRC checking 
is transferred through the Modbus protocol without changing.





PACKET MODE 
- Radiomaster - Slave communication example

Radioslave  \|/....\|/  Radiomaster             Slave simulator
             |      |
  691122FF -RFC    RFC- 69112205 - SCC ==== SCC - 00000001  

                       SPe0t                       SPe0t
                       (m)RM   (p)ON               (m)RS    (p)ON
                       (M)(f)691122FF              (S)(a)5
                          (a)FF
                          (0)5                                
                          (p)200*10
                          (t)200*100
                       (P)(A)0                     (P)(A)0
                          (N)2000                     (N)2000
                          (H)1000                     (H)1000
                                                   (s)(d)1
The Slave simulator address 00000001 is an arbitrary nonzero value. The Slave
 address is designated with parameter "SPe0tSa".
Radiomaster asks the Slave with period "Spe0tMp" for the content of its descriptor
"SPe0tPH" on address 1000.
We can send the data AAAA with the "its" function from the Radiomaster to its own
 address (so in SCC0). The data is sent into bufferN2H and then is transferred to
 the N2H buffer in the Slave by the following steps:

Monitoring: source 69112205|1.
07:44:06.834 tx      8 | S00
0503 1000 0001 814E            = Slave 5, do you have any data for me ?
07:44:06.851 rx;i    7 | S00
0503 0200 0049 84              = I don't

Send packet: (N):1   (d):69112205h
(t)ype:0009h
s(o)urce:691122FFh             = the Radioslave's address simulation
d(a)ta:..                      = the data AAAA in hexadecimal form
random data (l)ength:0byte
(r)epeat period:0ms + (j)itter:0ms
IP (P)ing
(s)tart r(e)port sto(p)
(q)uit
>>s

07:44:08.835 tx      8 | S00
0503 1000 0001 814E
07:44:08.851 rx;i    7 | S00
0503 0200 0049 84
07:44:09.198|                 |69112205 691122FF|S00I    IN    2|09 6user 
AAAA                           = prot. Radiomaster received data for Slave 5 
07:44:10.836 tx      8 | S00
0503 2000 0001 8E4E            = Slave 5, do you have an empty H2N buffer?
07:44:10.852 rx;i    7 | S00
0503 0200 0049 84              = yes
07:44:10.853 tx     19 | S00
0510 2000 0005 0A10 0809 0769 1122 FFAA AA82 73   = write the message
07:44:10.877 rx;i    8 | S00
0510 2000 0005 0A4E            = I have written the message
07:44:12.837 tx      8 | S00
0503 1000 0001 814E            = Slave 5, do you have any data for me ?
07:44:12.853 rx;i    7 | S00
0503 0200 0049 84              = no ... the questions continue
07:44:14.838 tx      8 | S00
0503 1000 0001 814E
07:44:14.854 rx;i    7 | S00
0503 0200 0049 84

The CU writes data in the N2H buffer and reads from H2N in its normal state. The
 parameter "SPe0tsd1" (= an arbitrary nonzero value) exchanges these directions, so
 the Slave simulator will write to address 1000 in the H2N buffer:

Radioslave >

13:24:51.176 rx;i    8 | S00
0503 1000 0001 814E            = Slave 5, do you have any data for me ?
13:24:51.177 tx      7 | S00
0503 0200 0049 84              = I don't   
13:24:51.725|                 |00000001 691122FF|S00I    IN    2|09 6user 
BBBB                           = prot. Slave sim. received data for the Master
13:24:53.177 rx;i    8 | S00
0503 1000 0001 814E            = Slave 5, do you have any data for me ?
13:24:53.178 tx      7 | S00
0503 0220 0851 82              = I have 08 byte
13:24:53.194 rx;i    8 | S00
0503 1000 0005 808D            = send me 5 words from address 1000,
13:24:53.195 tx     15 | S00               it includes a 10byte descriptor
0503 0A20 0809 8669 1122 FFBB BB96 CB  = I am sending 10 bytes
13:24:53.221 rx;i   11 | S00
0510 1000 0001 0200 0085 51    = clear the descriptor
13:24:53.222 tx      8 | S00
0510 1000 0001 048D            = I have cleared the descriptor
13:24:55.178 rx;i    8 | S00
0503 1000 0001 814E            = ... the questions to the Slave continue
13:24:55.179 tx      7 | S00
0503 0200 0049 84
13:24:57.179 rx;i    8 | S00
0503 1000 0001 814E

Radiomaster:
Monitoring: source 69112205|3.
13:24:53.295|                 |691122FF 69112205|S00I   OUT    2| 89 6user 
BBBB
13:24:53.296|691122FF 69112205|691122FF 69112205|R01I    IN    2N89 6dat
BBBB
13:24:53.298|691122FF 69112205|691122FF 69112205|036  RFTX     2*89 6dat
BBBB
13:24:53.340|69112205 691122FF|0005F7FF 1FB20031|036*29~ 45    0|06  ack

The Radiomaster obtains the data BBBB and the dst address 691122FF from Modbus.
 Radiomaster sends the data to the dst address with a MORSE packet. The address can
 be directed to the Radioslave (and then to the Modbus Master) or to another
 Radiomaster.









Connecting two (up to four) Slaves to a Radiomaster:

Radioslave  \|/....\|/  Radiomaster             Slave simulator
             |      |                  RS458 
  691122FF -RFC    RFC- 69112205 - SCC ===== SCC - 00000005 
                                          == SCC - 00000006  

                       Ne1MLn     = Multiaddressing
                         1l1
                       Tl1 p6
                           n5               Slave simulator 00000005:
                       SPe0t                       SPe0t
                       (m)RM   (p)ON               (m)RS    (p)ON
                       (M)(f)691122FF              (S)(a)5
                          (a)FF                    (P)(A)0
                          (0)5                        (N)2000
                          (1)6                        (H)1000
                          (p)200*10                (s)(d)1
                          (t)200*100        Slave simulator 00000006:
                       (P)(A)0                     SPe0t
                          (N)2000                  (m)RS    (p)ON
                          (H)1000                  (S)(a)6
                                                   (P)(A)0
                                                      (N)2000
                                                      (H)1000
                                                   (s)(d)1

The following monitoring examples shows the situation when only Slave 6 is
 connected. This is why the answers do not come from Slave 5 and the Radiomaster
 continues calling his Slave after time-out "SPe0tMt":

Monitoring: source 69112205|3.
11:22:04.079|                 |69112206 691122FF|S00I    IN    2|09 0user 
AAAA

Monitoring: source 00000001|1.
11:21:45.673 rx;i    8 | S00
0603 1000 0001 817D             = question to Slave 6
11:21:45.674 tx      7 | S00
0603 0200 000D 84               = response from Slave 6
11:21:47.673 rx;i    8 | S00
0503 1000 0001 814E             = question to Slave 5, waiting
11:22:07.684 rx;i    8 | S00
0603 2000 0001 8E7D             = dialogue with Slave 6
11:22:07.685 tx      7 | S00
0603 0200 000D 84
11:22:07.707 rx;i   19 | S00
0610 2000 0005 0A00 0809 0069 1122 FFAA AA05 D6
11:22:07.709 tx      8 | S00
0610 2000 0005 0A7D
11:22:09.684 rx;i    8 | S00
0503 1000 0001 814E             = question to Slave 5, waiting
11:22:31.695 rx;i    8 | S00
0603 1000 0001 817D             = question to Slave 6 ...
11:22:31.696 tx      7 | S00
0603 0200 000D 84
11:22:33.696 rx;i    8 | S00
0503 1000 0001 814E







CACHE MODE 
- packet sending Slave -> Radiomaster -> Radioslave

Radioslave  \|/....\|/  Radiomaster             Slave simulator
             |      |
  691122FF -RFC    RFC- 69112205 - SCC ==== SCC - 00000001  

SPe0t                  SPe0t                       SPe0t
(m)RS  (c)ON           (m)RM  (c)ON                (m)RS    (p)ON
(S)(a)FF               (M)(f)691122FF              (S)(a)5
                          (0)5
                          (a)FF                                
                          (p)200*10
                          (t)200*100
(C)(c)1                (C)(c)1                     (P)(A)0
   (r)40                  (t)30                       (N)0010
   (f)0                                               (H)0000
   (u)12               A  =Art table               
                       (N)1
                       (d)00000003 (w)00150010
                       (u)
The Slave simulator runs in the Packet mode and writes the data inputted with "its"
 to the address (N)2H, here 0010. The Radiomaster reads the data from addresses
 0010 to 0015 (according to Art, w) and, in the case of changing, sends it to the
 Radioslave. The data is also sent with a period of "SPe0tCt" (=30s).

Slave simulator 00000001:
Send packet: (N):1  (d):00000001h   = packet is sent with user output to the Modbus
(t)ype:0009h
s(o)urce:691122FFh            = this address is used by the simulator as dst
d(a)ta:..                     = data BBBB hex
random data (l)ength:0byte
(r)epeat period:0ms + (j)itter:0ms
IP (P)ing
(s)tart r(e)port sto(p)
(q)uit
>>
09:48:19.734 rx;i    8 | S00
0503 0010 0005 8588           = query about content of cache, addresses 0010 - 0015
09:48:19.735 tx     15 | S00
0503 0A00 0000 0000 0000 0000 002A 32s     = cache is empty
>>O.K.
>>
09:48:21.404|                 |00000001 691122FF|S00I    IN    2|09 6user 
BBBB
09:48:21.731 rx;i    8 | S00
0503 0010 0005 8588           = query about content of cache, addresses 0010 - 0015
09:48:21.732 tx     15 | S00
0503 0A10 0809 0669 1122 FFBB BB17 FC  = the record written with packet mode
09:48:23.736 rx;i    8 | S00
0503 0010 0005 8588
09:48:23.737 tx     15 | S00
0503 0A10 0809 0669 1122 FFBB BB17 FC

Radioslave 691122FF:
09:48:05.811|691122FF 69112205|691122FF 69112205|R01I   OUT   15n89 6dat
0503 0A00 0000 0000 0000 0000 002A 32    = picture of empty cache
09:48:21.910|691122FF 69112205|691122FF 69112205|R01I   OUT   15n89 7dat
0503 0A10 0809 0669 1122 FFBB BB17 FC    = the change in cache is transferred to RS

Here the Slave substitute used does not clear the (N)2H buffer automatically. It is
 necessary to clear the buffer using the initialisation protocol "SPeI" before
 repeating command "its". Then the newly written "its" causes new data transfer
 immediately. If no changes happen, then the cache is updated with time period
 "SPe0tCt".
The transparent mode is also configured in the RS and RM for command transfer in
 the direction MASTER -> RS -> RM -> SLAVE.

The cache state can be followed with the "mp0M" function:
- an example from Radioslave:

Modbus monitor:
St(a)tion  cache (d)ump
(q)uit
>>a
>>
Station activity in Modbus cache:
    /1  /2  /3  /4  /5  /6  /7  /8  /9  /A  /B  /C  /D  /E  /F  /10
 0   0   0   0   0  36   0   0   0   0   0   0   0                 
>>d5
The cache contains 12 positions for 12 Slaves according to the "SPe0tCu" parameter.
The active Slaves have the remaining validity time (max."SPe0tCr") written here.
  The content of chosen cache can be read using the "d5" command. The length of the
 written record 10byte is defined in the Art table, item "w", from addresses 0010
 to 0015:
>>
cache data at position 5:
         /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /B /C /D /E /F  ASCII:
00000000 20 08 09 06 69 11 22 FF BB BB                     ...i."...
>>

The cache arrangement can be changed and the memory space saved using the
 parameters for address shift and for the number of addresses in "SPe0tC", e.g.:

adr o(f)fset:5  n(u)mber:6  net addresses 

The unused positions 1 to 4 are omitted and the number of positions is reduced 
to 6:
>>
Station activity in Modbus cache:
    /1  /2  /3  /4  /5  /6  /7  /8  /9  /A  /B  /C  /D  /E  /F  /10
 0  32   0   0   0   0   0                              
>>d1

>>
cache data at position 1:
         /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /B /C /D /E /F  ASCII:
00000000 20 08 09 07 69 11 22 FF BB BB                    ....i."...
>>




Valid for sw version 657 from 4.3.2004.

©  2024 RACOM s.r.o. All Rights Reserved.