Answer the question
In order to leave comments, you need to log in
How to convert custom command set for serialport (RS485) to bytes?
There is a physical piece of iron that accepts a set of commands. The exchange is carried out by ASCII characters.
From the documentation: "all bytes are transmitted as two ASCII characters with the high byte first. For example, the command "A" 34h,31h"
It is not clear how these character commands are translated into two bytes in nodejs. How to make from "A", for example, 0x34 0x31
And the checksum is considered as XOR for all characters up to the CRC field. Here is also a question. The same "A" is translated through charCodeAt (0) immediately into 65. I'm afraid the bitwise comparison will also be incorrect.
Basically, I'm asking for help!
Answer the question
In order to leave comments, you need to log in
Release, do not need links to the docks. I google and tell.
Modbus protocol.
How to make from "A", for example, 0x34 0x31ASCII("A")=41h
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question