Hello,
Different instruments expect different things, so be sure to check your VNA manual on this. Say the command you are sending is "*IDN?"; some instruments actually expect a carriage return (\r), a linefeed (\n), or both. Below is an example of an instrument that would require \n to terminate commands sent to it. Remember that "\n" stands for the single hex code 0x0a and not for the two characters "\" and "n". Whatever language you are programming in will need to interpret this code so that you're sending the correct data.
To do this write, the wrt command can take an extra parameter which is the byte count. So, your write command to address 5 might look something like this:
"wrt #6 5\n*IDN?\n\n"
The #6 specifies that we will be writing 6 total ch
aracters: *, I, D, N, ?, and \n. The 5 is the GPIB address to write to, and following that is a \n that separates the command from the string. Next, we have our 6 characters followed by the final terminating \n. Remember that BASIC programming languages will automatically add the final \n onto its PRINT statements, so this is not needed if you're programming in BASIC.
Hope this helps.
Scott B.
National Instruments
Applications Engineering