That`s pretty easy. Try to get the standard of the protocol. I did that and in a few hours worked fine. Try this: int address, function, register, quantity address=incomingframe[0] function=incomingframe[1] register=(int)(incomingframe[2]+incomingframe[3]) quantity=(int)(incomingframe[4]+incomingframe[5]) if addres==myAddress then select case function case 0: break; case 1: case 2: //send data required by register and quantity case 3: case 4: //send data required by register and quantity case 6: //write single register case 15: //write multiple coils, mask found within message case 16: //write multiple holdings, asi sent in incoming message end case; endif; good luck.