The vI you posted reallly doesn't explain much since it is just a slightly modified shipping example. You don't provide any information on the make and model of instrument or the actual commands you are sending. I also don't understand what you are trying to read from a function generator. These instruments
output a waveform that must be
measured by something else. What is connected to the output to physically measure it? You can command a function generator to do an output and query what it is doing but you normally can't take an actual measurement with one. If you are trying to command it to do something, have you tried to look for an existing driver for the instrument? There are thousands available at
http://www.ni.com/devzone/idnet/default.htm. Go there and do a search. Also, with serial instruments, there are a lot of things that you can do wrong. You can have the wrong cable or the wrong settings for the serial port. You should always first try communicating with it in either MAX or Hyperterminal before trying to write your own program.