Device connection diagram for the R2-Net bus
Each device basically has four wires, two for power and two for R2-Net communication. It is possible that depending on the characteristics of the device there are more connections or variants.
What is it and … what format does a telegram have?
The telegram is about the sending of a data number by the R2-Net bus. The standard format of a telegram is as follows:
- Header – Command – Unit – All – Data – End of frame
- Header: it is a frame start byte, it is always the character “@” -> ascii 64.
- Command: is a byte that contains the command to perform.
- Unit: is the number of the device to which the telegram is addressed (recipient).
- All: is a priority byte to Unit. What it does is that all the devices that have implemented the command act with the content and data of the telegram.
- Data: byte with the value of what is transmitted.
- End of frame: byte indicating the end of the frame, always character CR -> ascii 13.
This is the color command of the R2-Net holo-projectors, in total 9 bytes:
- Header – Command – Unit – All – Red – Green – Blue – White – End of frame
- Header: character “@” -> ascii 64
- Command: character “L” -> ascii 76
- Unit: recipient -> 1
- All: Byte all -> 0
- Red: byte with the value of the color red (0-255)
- Green: byte with the value of green color (0-255)
- Blue: byte with the value of the color blue (0-255)
- White: byte with the value of white color (0-255)
- End of frame: byte indicating the end of the frame -> ascii 13.
The telegram to set holo-projector 2 to 100% Blue is as follows:
- @ L 2 0 0 0 255 0 13
The “all” byte is especially important when we want all the devices of the same command to be affected, if for example we want the three holo-projectors to turn blue, it will suffice to send the same telegram setting the byte to 1 “all “…
It looks like this:
- @ L 2 1 0 0 255 0 13
For this purpose, all the devices on the bus that have the “L” command will be affected by this telegram.