The MiniNet protocol is used in Bernecker & Rainer (Austria) equipment. Communication in networks with this equipment is always of the Master – Slave variety.
Important | |
---|---|
The terminology is unified from Setr version 9.0.17.0 according next schedule: PLC Master - CU RADIOSLAVE ... CU RADIOMASTER - Slave PLC CU (radiomodem) connected via SCC to PLC Master is called
Radioslave (RS), The older Setr uses the reverse terminology, also: ( PLC Master - CU RADIOMASTER ... CU RADIOSLAVE - Slave PLC ) |
Most of packets in the MiniNet protocol are characterised with this structure:
| STX/8 | LEN/8 | NODE/8 | INDEX/8 | DATA/8*N | CHK/8 |
where:
STX | beginning of packet 02h. If 02h occurs in the data, 00h has to come after it. i.e. 02h is transmitted as 0200h |
LEN | length (from STX up to and including CHK), supplemented 00h in the data (after 02h) is not counted. LEN can acquire values from 05h to FFh. |
NODE | address, see also the parameter |
INDEX | identification of packet for understanding requests and replies at the master (numbering, repeating, errors etc.) |
DATA | sequence of data bytes |
CHK | check byte (for calculation see below) |
An exception to the above mentioned structure is the single byte packet ACK (06h), which is only sent by the Slave in reply to certain master requests.
The protokol MININET-MORSE selects the above data structure from any incoming frame. In practice most PLCs send a differing number of synchronisation bytes FFh before STX and after CHK.
Protokol MININET-MORSE vybírá výše uvedenou strukturu dat z jakéhokoliv došlého rámce. V praxi většina PLC vysílá před STX a za CHK různý počet synchronizačních bytů FFh.
Addressing:
CU (MR400) RS always sends data to the address which it creates by overwriting the lowest byte of its own address (on the relevant node) with the NODE byte, see Data Format. In the case that NODE is 10h (broadcast) the packet is discarded. The CU RM always sends data to the address that the request came from.
a) PLC ->
MR400
In case of RM device check whether data is expected. The RM can only send data as a reply to a request – unexpected data is discarded.
Check whether the received packet has min. size of 5 bytes (exception only at RM device for ACK). Shorter packets are discarded.
STX is searched for in the received packet STX, i.e. the packet does not need to start with STX. If STX is not in the packet (not followed by 00h), the packet is discarded.
Check length of LEN. If it is larger than the size of the received packet the packet is discarded.
According to the given length of LEN, CHK is searched for, i.e. packet does not need to end with CHK.
Check CHK.
Only INDEX and DATA are transmitted through the air (see Data Format). STX,LEN,NODE,CHK are not transmitted. Packets are transmitted though the air as USER DATA types. In case of ACK the USER DATA packet is transmitted with a data length of zero.
b) MR400 ->
PLC
STX,LEN,NODE, CHK are supplemented to the relevant position (calculated) of the received data “from the air”.
Only the RS can receive a packet with zero length. In this case a single byte packet 06h is created.
Packet sent to port.
From the above it is obvious that only service data and index secured with MORSE system algorithms are transmitted through the air. Data on the wire link is protected by MiniNet protocol algorithms.
There is no handshake used on the CU-PLC link – not even SW (via ACK or other characters in the link layer of the protocol) not even HW (only three connections are used – RXD, TXD, GND). In case of overflow of queues of packets for sending into the air (4 packets) there is no way to inform the PLC, and therefore other possible incoming packets are discarded.
PLC Master - RADIOSLAVE ...... RADIOMASTER - PLC Slave MiniNet 690F0011 690F0022 MiniNet PLC Master ----> RS 11 (RADIOSLAVE 690F0011) FFFFFF 02 07 22 40 1B52 4B FFFF request RS 11 ----> RM 22 40 1B52 source address 11 is aved in the CU RM 22 RM 22 ----> PLC Slave 02 07 22 40 1B52 4B PLC Slave ----> RM 22 FF 02 06 22 C080 DA FFFFFF response RM 22 ----> RS 11 C0 80 RM 22 sends the packet to the address 11 RS 11 ----> PLC Master 02 06 22 C0 80 DA
MININET parameters: PLC Master - CU RADIOSLAVE ... CU RADIOMASTER - Slave PLC (m)ode :RADIOSLAVE (wired to master) (s)lave adr :FFFF (q)uit
(m) |
ATTENTION – The Setr older than 9.0.17.0 uses the reverse labelling ! |
(s) | For CU RADIOSLAVE only
|
Byte Minet::calc_chk(Byte *pb, Word size) { Word chk, i; chk = 0; i = 0; while (i < size) { if ((*(pb - 1) == (Byte)STX) && (*pb == 0) && (i>4)) { //4=STX|LEN|NODE|INDEX i++; //supplementary 00 after STX in data area is not included pb++; } else { chk <<= 1; if ((chk & 0x100) == 0x100) { chk += 1; chk &= 0xFF; } chk += *pb++; if ((chk & 0x100) == 0x100) { chk += 1; chk &= 0xFF; } i++; } } if ((Byte)chk == (Byte)STX) chk = ~chk; return((Byte)chk); }//Minet::calc_chk