08-03-2010 10:19 AM
I am just curious as to whether there is a general rule of thumb or what the pros and cons are of each method (as far as time and robustness). If it is possible to send multiple SCPI commands over the GPIB using a single call of VISA write, it it better to do it this way or to send each command independently. I am most interested in time and robustness benefits. Thanks for your help!
-Anthony
08-03-2010 10:23 AM
Check your instrument documentation about the syntax of multiple commands. A common method is to separate them with a ';'.
I have not done any benchmarking in a while. Using a single write is a bit faster but not sure whether you would notice it.
08-03-2010 11:18 AM
By sending combined commands you can improve throughput in two ways.
First- you make one call to the VISA API so the machine only needs to go through the VISA overhead once (not a lot of CPU usage but it does save some)
More importantly, you can send fewer characters over the GPIB interface. not all commands need to transition all the way to root";" so multiple commands only need to navigate to the nearest common branch. For Example: "Trig:Sour imm;Trig:lev 1.0" is identical to "Trig:Sour imm:lev 1.0" semi colon transitions to root colon backs up 1 level of the command tree