If the IP address and mask are configured directly on gig 0/1 of the 3140 and not on an 802.1q subinterface, then the switch VLAN interface within the same subnet as the 3140 should be the VLAN of the access port to which the 3140 is connected.
In other words, if you have on the 3140:
interface gigabit 0/1
ip address 192.168.10.1 255.255.255.0
And the switch is set up like:
interface VLAN 10
ip address 192.168.10.10 255.255.255.0
Then on the port to which the 3140 is connected should be:
interface gigabit 0/24
switchport mode access
switchport access vlan 10
If this doesn't fix it, post configs of both the switch and the 3140 with passwords removed.