Receiving a message:
import plc_without_protocol |
#continuously read without protocol |
plc = plc_without_protocol.plc() |
input_bytes = None |
while(input_bytes is None): #blocking until value is received |
input_bytes = plc.read() |
input_buffer = bytearray(input_bytes) |
#... |
Or sending a message with the same format as above:
#write without protocol |
output_buffer=bytearray(254) #fill with data to be sent |
plc.write(bytes(output_buffer)) |
#... |