code warier XBEE

When I try to read data from pin4 and give that value to pin 7 it is not working.Also the pin4 as
input and pin 7 as out put
gpio_set(XPIN_7,gpio_get(XPIN_4));