I am not answering the question that you asked. You cannot get 4 values from the READMODBUS function, just one.
Your code:
Z = READMODBUS (13,1,3104)
The READMODBUS function returns a single 16-bit value. You assigned this value to the 32-bit variable Z. Where are the other 3 values that you said that you were getting?
The 3rd argument to READMODBUS should have been &h3104 (hexadecimal not 3104 (decimal). It is a good bet that your Modbus device rejected this modbus query. Your Modbus device probably returned an error status and not the value of some register.
You must check the value from Status(2) to determine if the READMODBUS function completed without error and the value that was returned has any meaning.
Your test code uses the Modbus function code of 4. The READMODBUS function uses the Modbus function code of 3. These two function codes are different and your Modbus may return values from different registers based on the function code that you used.
You can force READMODBUS to use the function code 4 instead of 3 with this statement:
Setsystem 6,4
Gary D*ckinson