Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5635

Having issues with simple serial communication.

$
0
0

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:

  1. 0xF4 + 0x41 + 0x20 + 0x00 = 0x0155
  2. Take the 1’s compliment of that value: 0xFEAA
  3. Append the new checksum to the end of the frame: 0xF4, 0x41, 0x20, 0x00, 0xAA, 0xFE

Viewing all articles
Browse latest Browse all 5635

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>