I assume you are using COMM3 (RS485 port)?
First you should set up a single action circuit triggered by an input:
IN1 TestMB
|---||----------{dCusF}
Inside the TestMB custom function, try this:
X = READMODBUS(13, nn, XXXX) ' 13 means Modbus RTU protocol.
' use 3 for Modbus ASCII protocol.
nn is the ID of the MODBUS RTU slave and XXXX is the binary offset address of the registers in the RTU device
typically xxxx = Modbus Holding Register (4xxxxx) - 40001
So e.g. if MODBUS slave ID is 05, and MODBUS register address is 40015, then xxxx = 40015 - 40001 = 14.
X = READMODBUS (13, 5, 14)
Go online monitoring and click on IN1 to trigger a single run of the TestMB function and check the value of X. If should show the read value of the MODBUS register 40015 of slave ID = 05.
Once you get this done, you would have succeeded in talking to the MODBUS RTU slave and you can take it from there. WRITEMODBUS is similar.
If your MODBUS register is at 3xxxx then you need to change READMODBUS and WRITEMODBUS to use function 04 instead of default function 03. Please refer to the following thread for details:
http://www.tri-plc.com/yabbse/index.php?board=2;action=display;threadid=298