Illegal Function generally means you are trying to read a slave device with a function code that is not supported by the device or in the modbus spec. You might try reversing your RS-485 wires or checking your code because I'd be surprised if 7F was a valid function code. The more common function codes are 03 and 04.