As others have done, i'd recommend you to close the program with a stop button, but be sure you only open the session once, and so you do with the close option. Put them outside the loop, this way, you only open GPIB once, pass the reference into the loop, read/write as much as you want, and place the close session vi outside, so that it closes only when the loop is over.
Hope this helps