I recommend that you consider using the "instrument driver" available on our IDNet (Instrument Driver Network) to assist you in programming. These instrument drivers are a set of functions (or VIs) that often simplify communication with specific instruments. Here is a link to the web page for the HP3497A driver. Be sure to download the appropriate one for your development environment (LabVIEW / CVI).