An example showing how to connect and communicate with a Radwag bargraph via RS232 using Json protocol.
Project was written in Net Framework v4.8 with WPF, Project using System.Text.Json Version=7.0.0.0 liblary.
After entering the serial port name, you can manage the bargraph via json protocol.
- Content - object with all settings necessary to manage bargraph device.
- Address - Address of device (default 255)
- IsRequest -
- Power - power of luminous segments
- Red - a table containing the states of individual bargraph (Red)segments
- Green - a table containing the states of individual bargraph (Green)segments
- Crc - 8bit CRC
- Set all red segments light on with power of light 70%
{"Content": {"Address": 255, "IsRequest": true, "Power":70, "Red": [1, 1, 1, 1, 1, 1, 1, 1, 1], "Green": [0, 0, 0, 0, 0, 0, 0, 0, 0]}, "Crc": "bf"}
- Set all green segments light on with power of light 70%
{"Content": {"Address": 255, "IsRequest": true, "Power":70, "Red": [0, 0, 0, 0, 0, 0, 0, 0, 0], "Green": [1, 1, 1, 1, 1, 1, 1, 1, 1]}, "Crc": "bf"}
- Set all segments light on with power of light 100%
{"Content": {"Address": 255, "IsRequest": true, "Power":100, "Red": [1, 1, 1, 1, 1, 1, 1, 1, 1], "Green": [1, 1, 1, 1, 1, 1, 1, 1, 1]}, "Crc": "bf"}
- Set all segments light off with power of light 0%
{"Content": {"Address": 255, "IsRequest": true, "Power":0, "Red": [0, 0, 0, 0, 0, 0, 0, 0, 0], "Green": [0, 0, 0, 0, 0, 0, 0, 0, 0]}, "Crc": "bf"}
- Clone or download this repository.
- Open project in Visual Studio.
- Build and run.