Python read write serial port example

broken image
broken image
broken image

Self.id.write(str.encode('get status\r')) When I send regular write commands, the instrument outputs text indicating the changes made as shown below: self.id.write(str.encode('send write command\r')) However, recently I found an issue that I think it's due to sending multiple write commands and I only need to read when I query the instrument.

broken image

I created a class to help me read and write into an instrument using serial port. First time posting here, I think I posted the 'code' part correctly but didn't know about the output part.

broken image