The SNAP-PAC-R2 is a Modbus/TCP slave device as it comes from the factory. (No extra programming needed.)
You can also turn it into Modbus Master via the subroutines (like a library of commands) in our Modbus Integration Kit. This same integration kit includes slave subroutines for both TCP/IP and Serial.
More overview info on Opto 22 + Modbus can be found here:
I hope that helps!