How can i upload file from PC to spectrum analyzer(N9020A) using VEE?
i can copy file from instrumnet to pc using MMDM:DATA command.
but i have no idea how to upload file from pc to instrument.
could you share simple vee example?
How can i upload file from PC to spectrum analyzer(N9020A) using VEE?
i can copy file from instrumnet to pc using MMDM:DATA command.
but i have no idea how to upload file from pc to instrument.
could you share simple vee example?
In case my previous reply didn't get you to the right place, here's a quick example that should be pretty close.
###################
(saveFormat "7.0")
(date "Sat 10/Aug/2019 14:25:31 ")
(veerev "7.0.6310.0")
(platform "PC")
(execMode v6)
(filterNAN 0)
(workspaceStackingOrder M)
(SaveCF no)
(device 0 ROOTCONTEXT
(properties
(trigMode deg)
(nextID 3)
(popupTitleText "Untitled")
(popupMoveable 1))
(deviceList
(device 0 FROMFILE
(properties
(transactions 1 "READ BINARY x BYTE ARRAY:*"))
(interface
(output 1
(name "X")
(optional yes)))
(implementation
(attr iopath file read "c:\\temp\\myfile"
(readTerm "\n")
(fs " ")
(eol "\n")
(multiField fullSyntax)
(arrayFormat block))))
(device 2 IODEVICE
(properties
(name "newInstrument2 ( @ (NOT LIVE))")
(transactions 3 "WRITE TEXT \"MMEM:DATA \"" "WRITE TEXT \"myFileOnInstrument,\""
"WRITE BINBLOCK a BYTE EOL"))
(interface
(input 1
(name "A")
(optional yes)))
(implementation
(iopath "newInstrument2")))
(configuration
(connect D0:1 D1:1)))
(contextCarrier
(wndOrigin 2 2)
(wndState res)
(active detail)
(detail
(extent 1212 730)
(anchorPt -1 1)
(configuration
(devCarrierFor 0
(active open)
(icon)
(open
(extent 231 108))
(terminals on)
(pinCenter 310 360))
(devCarrierFor 2
(active open)
(icon
(iconImage "io.icn"))
(open
(extent 254 106))
(terminals on)
(pinCenter 720 380))
(connect D0:1 D1:1
(points 4 458 360 480 360 480 380 560 380)))
(stackingOrder 0 1))
(numberFormats
(realFormat standard)
(realSigDigits 4)
(realRadixSpec 4)
(integerBase decimal))))
####################
Of course you might also consider that the 9020 is an instrument but underneath it is also a Windows machine with the"spectrum analyzer" being a piece of software running on that Windows machine. Since that's the case you could totally ignore the SCPI interface and use basic networking to move your file ( as in copy c:\temp\myfile \\9020networkname\share\path )(use robocopy if you have a bunch to copy) . From VEE you would use the Execute program object as needed. This has three advantages: no need to mess with the "instrument" interface, uses standard networking tools, and doesn't require reading the file into VEE (problematic for a large file).
No way to test it here, but quick perusal of the instrument manual shows that you are kinda close:
#############manual excerpt #############################
Mass Storage Data (Remote Command Only)
Creates a file containing the specified data OR queries the data from an existing file.
Key path SCPI Only
Remote Command :MMEMory:DATA <file_name>, <data>
:MMEMory:DATA? <file_name>
Notes The string must be a valid logical path.
The command form is MMEMory:DATA <file_name>,<data>.
It loads <data> into the file <file_name>.
<data> is in 488.2 block format. <file_name> is string data.
The query form is MMEMory:DATA? <file_name> with the response being the associated <data>
in block format.
############## end manual excerpt #################
Which would say that MMEM:DATA would be used to transfer file TO the instrument and MMEM:DATA? would be used to transfer file FROM the instrument. Note that in both cases the file is sent as a binblock, which makes sense since then any file will work. From VEE end read in the file as a byte array then output to the instrument in binblock format and you should be set to go.
Stan