The Cactus protocol transfers the data between Master PLC Cactus and the Slaves PLCs. Data is transferred to the radio channel without being modified and is checked using the checksum.
The items are composed from the hexadecimal numbers coded in ASCII. E.g. the item 0x3744 represents the hex numbres 0x7D.
Data frame structure and the example:
| IDENT/16 | SERV/16 | DATA | CHS/16 | CR/8 |
3744 3039 3030 3836 0D
IDENT/16 | the Slave identity |
SERV/16 | the cactus service number |
DATA | data, the even number of data pairs |
CHS/16 | checksum |
CR/8 | end of frame, always 0x0D |
Pooling call:
| IDENT/16 | CR/8 |
3744 0D
Acknowledge:
| ACK/8 | CR/8 |
21 0D
ACK/8 | ackknowledge, 0x21 represents the ! symbol |
CR/8 | end of frame, always 0x0D |
No Acknowledge:
| NACK/8 | CR/8 |
3F 0D
NACK/8 | nonackknowledge, 0x3F represents the ? symbol |
CR/8 | end of frame, always 0x0D |
The checksum counting
The checksum is counted from the items IDENT, SERV and DATA. The process for all type of SERV except 0x1C:
Each byte of the frame represents one hex character according to ASCII table. The resulting hex characters in pairs are summed and the last two characters in ASCII form creates the checksum. Example:
3744 3039 3030 3836 0D … the frame with the type SERV = 3039 = 0x09
0x7D + 0x09 + 0x00 = 0x86
0x86 in ASCII is 3836 and this is the CHS/16
The process for type SERV 0x1C:
The bytes are summed in this form which is in the frame. Last two characters of the result are expressed in ASCII:
3744 3143 4148 4F4A 3131 0D … the type SERV = 3143 = 0x1C
0x 37 + 44 + 31 + 43 + 41 + 48 + 4F + 4A = 0x 211 -> 0x11
0x11 in ASCII is 3131 which is the CHS/16
The network arrangement.
CACTUS CU 73112200 CU 7311227D CACTUS 7D MASTER --- RADIOSLAVE .................. RADIOMASTER --- SLAVE : : CU 7311227E CACTUS 7E :......... RADIOMASTER --- SLAVE
The PLC Cactus Master is connected by vires to the MORSE CU Radioslave which has the MORSE address ending with 0x00.
The PLC Cactus Slave having the identity e.g. 0x7D is connected to the CU Radiomaster. It uses the MORSE address ending with the same characters 0x7D. The higher part of MORSE address is the same as at CU Radioslave.
The traffic possibility:
Pooling in the quiet state
Master PLC sends the pooling call to the PLC Slave and it answers:
MASTER PLC SLAVE PLC 0x37440D --> 0x37440D 0x37440D <-- 0x37440D
Request from MASTER and response from SLAVE
SLAVE PLC sends data only after request:
MASTER PLC SLAVE PLC 0x37440D --> 0x37440D 0x37443039303038360D <-- 0x37443039303038360D 0x210D --> 0x210D
RADIOSLAVE CU remembers the SLAVE identity after receiving the dataframe from SLAVE PLC to be able send the ACK from MASTER PLC to the appropriate SLAVE PLC. Only one ACK can be sent.
Data from MASTER
MASTER PLC can transmit spontaneously:
MASTER PLC SLAVE PLC 0x37443039303038360D --> 0x37443039303038360D 0x210D <-- 0x210D
Example with the SERV type 0x1C:
MASTER PLC SLAVE PLC 0x3744314341484F4A31310D --> 0x3744314341484F4A31310D 0x210D <-- 0x210D
The RADIOSLAVE transmits the frame to the RADIOMASTER and received ACK:
>> 15:13:17.890 rxsim 9 | S02 3744 3039 3030 3836 0D 15:13:17.891| |7311227D 73112200|S02I OUT 9||89 2usr 0 3744 3039 3030 3836 0D 15:13:18.189| |73112200 7311227D|S02I IN 2|*09 6usr 0 210D 15:13:18.189 tx 2 | S02 210D
The RADIOMASTER received the frame from RADIOSLAVE and transmits the ACK:
>> 15:13:17.977| |7311227D 73112200|S02I IN 9|*89 2usr 0 3744 3039 3030 3836 0D 15:13:17.977 tx 9 | S02 3744 3039 3030 3836 0D 15:13:18.152 rxsim 2 | S02 210D 15:13:18.152| |73112200 7311227D|S02I OUT 2||09 6usr 0 210D
PLC Master - CU RADIOSLAVE ... CU RADIOMASTER - Slave PLC (m)ode:RADIOMASTER (wired to slave) Center (a)ddr:2200 Max (g)ap:20ms (q)uit >>
(m)ode | m – RADIOMASTER – CU wired to the PLC SLAVE |
Center (a)ddr | down part of the RADIOSLAVE MORSE address, only RADIOMASTER uses this parameter |
Max (g)ap | 15 to 40ms recommended, max. possible interrupting inside incomming frame on wires. After longer break is the data regarded as a new frame. |
Note | |
---|---|
When MASTER sends the frame to the identity address 00, the the Cactus protocol in the RADIOSLAVE transmits it as broadcast. The broadcast setting must be prepared for this. It is used for network tunning purposes only. |