A Simple Protocol for Data Exchange with Small Processors

 

2/2/04

 

Glenn C. Johnson (johnson@fnal.gov)

David Peterson (peterson@fnal.gov)

 

 

The Antiproton Source is using Z-World Rabbit processors for small embedded systems.  The built-in Ethernet port allows communications with other systems and a simple protocol has been developed to exchange data with an Open Access Client (OAC).  The OAC presents the data to the ACNet controls system.

 

Communications are ASCII mode TCP/IP.  The OAC periodically queries the field processor. 

 

Two commands are recognized by the field processor:

Raaaa (or optionally Raaaa nn) : Requests a read of the 32 bit value from address aaaa (or nn 32 bit words starting at address aaaa).

 

Waaaa dddddddd : writes a 32 bit value dddddddd at address aaaa.

 

Upon receiving a read request the field processor responds

Raaaa=dddddddd

for however many words were requested.

 

Upon receiving a write command the field processor responds

Raaaa=dddddddd

to allow the OAC to immediately update the write value.

 

If the read request exceeds the allocated memory range the field processor will respond

“Address goes out of range”

 

If the write address is not acceptable the field processor will respond

“Address out of range”

 

Current implementations require the exchange of only a few words. 

 

For example: DRF3 uses 6 locations

0 = Setting location for frequency.
1 = Setting location for amplitude.
2 = Setting and reading for frequency slew rate.
3 = Setting and reading for amplitude slew rate.
4 = Reading of current frequency.
5 = Reading of current amplitude.

 

An annotated DABBEL template for two example devices:
 
MOD D:R3LLFR ( "DRF3 Frequency", srcnode ,         , 01FFFFFE, 0 )
!                                ^
!                                \ ACNET source node (e.g. DUE37)
SSDNHX READNG (005E/0003/0001/0004)
!                ^     ^    ^    ^
!                |     |    |    \ Memory address in Rabbit (hex)
!                |     |    \ Channel index in OAC (hex)
!                |     \ Must be 3
!                \ OAC class number from D92 (converted to hex)
PRO READNG ( 4, 4, 60)
!            ^  ^  ^
!            |  |  \ Default FTD is 1 hertz readback
!            |  \ Maximum array size in bytes
!            \ Default size in bytes
PDB READNG ( "bits", "Hz  ", 10, 2, 4, 0, 1, 0, 200000000,
!             ^       ^      ^   ^  ^  ^  ^  ^  ^
!             |       |      |   |  |  |  |  |  \ C1
!             |       |      |   |  |  |  |  \ MC (0 = normal D/A)
!             |       |      |   |  |  |  \ LS (1 = long display format)
!             |       |      |   |  |  \ DS (0 = decimal notation)
!             |       |      |   |  \ IDL (input data length in bytes)
!             |       |      |   \ Common transform index: 2 -->
!             |       |      |              x' = (C1*x/C2) + C3
!             |       |      \ Primary transform index: 10 --> x' = float(x)
!             |       \ Common units text
!             \ Primary units text
             4.29496730E+09, 0)
!            ^               ^
!            |               \ C3
!            \ C2
SSDNHX SETTNG (005E/0003/0001/0000)
!                ^     ^    ^    ^
!                |     |    |    \ Memory address in Rabbit (hex)
!                |     |    \ Channel index in OAC (hex)
!                |     \ Must be 3
!                \ OAC class number from D92 (converted to hex)
PRO SETTNG ( 4, 4, 300, 3C, 62, 05, 03)
!            ^  ^  ^    ^   ^   ^   ^
!            |  |  |    \   \   \   \  Initial setting value (hex bytes)
!            |  |  \ Default FTD is 1 hertz readback
!            |  \ Maximum array size in bytes
!            \ Default size in bytes
PDB SETTNG ( "bits", "Hz  ", 10, 2, 4, 0, 1, 0, 200000000,
!             ^       ^      ^   ^  ^  ^  ^  ^  ^
!             |       |      |   |  |  |  |  |  \ C1
!             |       |      |   |  |  |  |  \ MC (0 = normal D/A)
!             |       |      |   |  |  |  \ LS (1 = long display format)
!             |       |      |   |  |  \ DS (0 = decimal notation)
!             |       |      |   |  \ IDL (input data length in bytes)
!             |       |      |   \ Common transform index: 2 -->
!             |       |      |              x' = (C1*x/C2) + C3
!             |       |      \ Primary transform index: 10 --> x' = float(x)
!             |       \ Common units text
!             \ Primary units text
             4.29496730E+09, 0)
!            ^               ^
!            |               \ C3
!            \ C2
!
!
MOD D:R3LLFS ( "DRF3 Frequency Slew Rate", srcnode ,         , 01FFFFFE, 0 )
!                                          ^
!                                          \ ACNET source node (e.g. DUE37)
SSDNHX READNG (005E/0003/0000/0002)
!                ^     ^    ^    ^
!                |     |    |    \ Memory address in Rabbit (hex)
!                |     |    \ Channel index in OAC (hex)
!                |     \ Must be 3
!                \ OAC class number from D92 (converted to hex)
PRO READNG ( 4, 4, 60)
!            ^  ^  ^
!            |  |  \ Default FTD is 1 hertz readback
!            |  \ Maximum array size in bytes
!            \ Default size in bytes
PDB READNG ( "bits", "Hz/S", 10, 2, 4, 0, 1, 0, 1, 1, 0)
!             ^       ^      ^   ^  ^  ^  ^  ^  ^  ^  ^
!             |       |      |   |  |  |  |  |  |  |  \ C3
!             |       |      |   |  |  |  |  |  |  \ C2
!             |       |      |   |  |  |  |  |  \ C1
!             |       |      |   |  |  |  |  \ MC (0 = normal D/A)
!             |       |      |   |  |  |  \ LS (1 = long display format)
!             |       |      |   |  |  \ DS (0 = decimal notation)
!             |       |      |   |  \ IDL (input data length in bytes)
!             |       |      |   \ Common transform index: 2 -->
!             |       |      |              x' = (C1*x/C2) + C3
!             |       |      \ Primary transform index: 10 --> x' = float(x)
!             |       \ Common units text
!             \ Primary units text
SSDNHX SETTNG (005E/0003/0000/0002)
!                ^     ^    ^    ^
!                |     |    |    \ Memory address in Rabbit (hex)
!                |     |    \ Channel index in OAC (hex)
!                |     \ Must be 3
!                \ OAC class number from D92 (converted to hex)
PRO SETTNG ( 4, 4, 300, 01, 00, 00, 00)
!            ^  ^  ^    ^   ^   ^   ^
!            |  |  |    \   \   \   \  Initial setting value (hex bytes)
!            |  |  \ Default FTD is 1 hertz readback
!            |  \ Maximum array size in bytes
!            \ Default size in bytes
PDB SETTNG ( "bits", "Hz/S", 10, 2, 4, 0, 1, 0, 1, 1, 0)
!             ^       ^      ^   ^  ^  ^  ^  ^  ^  ^  ^
!             |       |      |   |  |  |  |  |  |  |  \ C3
!             |       |      |   |  |  |  |  |  |  \ C2
!             |       |      |   |  |  |  |  |  \ C1
!             |       |      |   |  |  |  |  \ MC (0 = normal D/A)
!             |       |      |   |  |  |  \ LS (1 = long display format)
!             |       |      |   |  |  \ DS (0 = decimal notation)
!             |       |      |   |  \ IDL (input data length in bytes)
!             |       |      |   \ Common transform index: 2 -->
!             |       |      |              x' = (C1*x/C2) + C3
!             |       |      \ Primary transform index: 10 --> x' = float(x)
!             |       \ Common units text
!             \ Primary units text
!