![]() ![]() Return: 01 01 02 00 41 79 CC //Relays 0 and 6 are on, the rest are off Return: 01 01 02 00 01 78 3C //Relay 0 is on, the rest of the relays are off. Return: 01 01 02 00 00 B9 FC //All relays off Returns all bytes of the status information 3 relay flip: 01 05 00 03 55 00 02 9AĠx00 is the broadcast address 0x01-0xFF indicates the device addressĠx00 is the broadcast address, 0x01-0xFF is the device address The serial port will output the commands sent.ĭevelopment Protocol Function Code Introduction Function CodeĠx00 is the broadcast address 0x01-0xFF is the device addressĬontrol the register address of the relay, 0x00 - 0x000FĬRC16 checksum of the first 6 bytes of dataĬontrol the register address of the relay: 0x0000-0x000F The relay module will turn on and then turn off in order to run normally. Use Arduino IDE to open the program, select the corresponding development board and then download the program. ![]() The Arduino demos are based on the NUO PLUS and RS485 CAN Shield modules. The serial port will output the command sent. Normal operation of the relay module will turn on and then turn off in turn. Note that before using the computer to ensure that the keil5 software has been installed, download the program to the development board can be downloaded. The STM32 demos are based on the NUCLEO-F103RB and the RS485 CAN Shield module.įind the STM32 program file directory and open the STM32 project. If you use other 485 devices, you need to make sure A-A and B-B. If you want to insert the RS485 CAN HAT into the Raspberry Pi, connect the A and B ports of the Modbus RTU Relay module and the RS485 CAN HAT module. If there is none, you can add it at the end of the file.įor Raspberry Pi 3B users, the serial port is for Bluetooth and needs to be removed. Open /boot/config.txt file, and find the following configure sentence to enable the serial ports. Open the Raspberry Pi, and input the following commands to enter the configure interface:Ĭhoose Interfacing Options -> Serial, disable shell visit, enable the hardware serial port For NUCLEO-F103RB and Arduino, it is recommended to use an RS485 CAN Shield module. It is recommended to use an RS485 CAN HAT module with the Raspberry Pi. Note: RS485 cannot be directly connected to the Raspberry Pi's serial port as it may damage the devices. For detailed control commands, please check the development protocol.When entering the command, if the first six bytes are provided and you click on "Send," the CRC checksum will be automatically added. If you need to send other commands, select "HEX" as the sending format and choose "Modbus CRC16" as the checksum.Clicking on the corresponding function will send the corresponding command. Clicking on multiple strings opens multiple string-sending windows. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |