I got the write command to work. Below is the code I’m using to write a two byte HEX message (82 7D) out of the serial port:
system.serial.configureSerialPort(\
port="COM8",\
bitRate=system.serial.BIT_RATE_57600,\
dataBits=system.serial.DATA_BITS_8,\
handshake=system.serial.HANDSHAKE_CTS_RTS,\
hardwareFlowControl=True,\
parity=system.serial.PARITY_NONE,\
stopBits=system.serial.STOP_BITS_1)
port = "COM8"
system.serial.openSerialPort("port")
system.serial.writeBytes(port, "\x82\x7D")
Now the next step is to read data. The write message above doesn’t request the device to provide a response, but I do have other write commands that do. So is there away to cast the system.serial.readBytes data to HEX? Also is there any way to create a port listener? If so will the port listener need to be disabled when a write command is activated?