Hi,
I have optics module which communicate on serial bus. I am using Visa serial bus to talk to it.
Bus Frame is like this
1. Start of header : 1 byte
2. Address : 1 byte
3. Command :1byte
4. Data length: 1 Byte
5. Data: 0-255 Bytes
6. Checksum: 2bytes
I have to send command in hex format , and visa serial bus takes string to write it to the port.
i am not able to communicate with the module.
Checksum Computation
If the following frame needs to be transmitted: 0xF4, 0x41, 0x20, 0x00 the checksum should be as follows:
- 0xF4 + 0x41 + 0x20 + 0x00 = 0x0155
- Take the 1’s compliment of that value: 0xFEAA
- Append the new checksum to the end of the frame: 0xF4, 0x41, 0x20, 0x00, 0xAA, 0xFE