There isn't a direct command in the Visa32.bas file. You have to play with the viPrintf format modifiers for "#zb" for Real32 (you give it an array of Singles) or "#Zb" or Real64 (you give it an array of Doubles).

Try the Simulated Cal example on the Examples page (http://na.tm.agilent.com/pna/programming/scpi/scpi.html). You also do not have to use a binary block. I used binary block due to speed, if you change the data type to ASCII ("FORM:DATA ASC,0"), you can just push strings to the PNA (even in the new way).

For j = 1 To 2 For i = 1 To 6 If i < 3 Then Debug.Print &#40;i - 1&#41;, &#40;i * j - 1&#41;, j, j End If If i > 2 Then For k = 1 To 2 If k <> j Then Debug.Print &#40;i - 1&#41;, &#40;i * j - 1&#41;, j, k End If Next k End If Next i Next j

That could definitely be a bug. I did notice one where I forgot to increase the values in the if statements by 1 (from 2 to 3 and from 3 to 4) after re-basing the loops from 0 to 1. This explains your final comment regarding the number of pairs. I will try to find time to dig into it more, but probably won't have it for at least the next week.

If et() array remains as declared in upload() function, the first column of index values appears to be incorrect. Instead of the first column being

0,1,2,3,4,5,0,1,2,3,4,5

shouldn't it be

0,2,1,4,5,3,0,2,1,4,5,3

?

The reason I say this is that it appears from the PNA Help file thateterms(0) is SCORR1 is EDIR,eterms(1) is SCORR2 is ESRM, eterms(2) is SCORR3 is ERFT,eterms(3) is SCORR4 is EXTLK,eterms(4) is SCORR5 is ELDM,eterms(5) is SCORR6 is ETRT

Not as written. As defined (et() = {"EDIR", "ERFT", "ESRM", "ELDM", "ETRT", "EXTLK"}), the array has 6 values and these are cycled through 1 port at a time, so you will see that the outer loop uses port 1 first (0-5) and then port 2 (0-5). Since we are not using the SCORR functionality, it does not have to match since the value in the et() array is sent with the upload to define what is being uploaded.

As far as I can tell the INPUCALC and SCORR mappings are the same. These mappings worked fine for a 2 port world, but when moving to a N-port world they don't work too well. Now you pick the error term ("Exyz") and the port combination (x, x for reflection measurements and x, y for transmission measurements) to read and push back the error terms.

I am hoping this writing of error terms is a one-of type of situation. :?

I have mapped the error terms as follows:SCORR1 EDIR,1,1SCORR3 ERFT,1,1SCORR2 ESRM,1,1

SCORR5 ELDM,2,1SCORR6 ETRT,2,1SCORR4 EXTLK,2,1

SCORR11 ELDM,1,2SCORR12 ETRT,1,2SCORR10 EXTLK,1,2

SCORR7 EDIR,2,2SCORR9 ERFT,2,2SCORR8 ESRM,2,2

I hope that this is correct.

The VB.NET example is downloading the error terms and modifying them, but I am only doing 1/2 of that - the uploading part. The current test program for the 8510C that I have inherited is generating the error terms. I need to match up the error terms in the code I have to EDIR, ERFT, ESRM, ELDM, ETRT, EXTLK in this new way of uploading them.

Also getting back to the the VB.NET code, I am thinking that array_index = (i * j - 1) should be array_index = i - 1 + (j - 1) * 6 to generate values 0 to 11 for a 2-port PNA. Please let me know if this makes sense.