func (d *Driver) DeleteFile(name string) (status vi.Status) {
	b := fmt.Sprintf("MMEM:DEL '%s'", name)
	_, status = d.Write([]byte(b), uint32(len(b)))
	return
}
def getFile(self, strSrcFilename, strDstFilename):
"""
Get file contents as raw binary data and save to file on local pc.
Usually used to fetch a screenshot or trace.
"""
strSrcFilename = strSrcFilename.upper()  # Convert filename to all uppercase per GPIB standard
# Agilent Command to read data file
self.write("MMEM:DATA? '%s'" % strSrcFilename)
strData = self.Instrument.read_raw()
# data is stored as a packed string in strData. Entire file is stored here, limited only by PC RAM.
if strData[0] == '#':  # must start with the # sign
Length_of_LengthBytes = int(strData[1],10)  # Second byte tells how many bytes it takes to tell us the full file length
dataLen = int(strData[2:2+Length_of_LengthBytes],10)  # Read bytes to tell how long data is
#print 'File Length is: %d' % dataLen
outfile = open(strDstFilename,'wb')
for i in range(2+Length_of_LengthBytes,len(strData)-1):
outfile.write(strData[i])
outfile.flush()
outfile.close
DeleteFile Deletes file name; name must include the full path.
package mxa
import (
	"fmt"
	"os"
	"strconv"
	"strings"
	vi "github.com/jpoirier/visa"
)
type Driver struct {
	vi.Driver
}
func OpenGpib(rm vi.Session, ctrl, addr, mode, timeout uint32) (*Driver, vi.Status) {
	name := fmt.Sprintf("GPIB%d::%d", ctrl, addr)
	instr, status := rm.Open(name, mode, timeout)
	if status < vi.SUCCESS {
		fmt.Println("Error, OpenGpib failed with error: ", status)
		os.Exit(0)
	}
	return &Driver{instr}, status
}
func OpenTCP(rm vi.Session, ip string, mode, timeout uint32) (*Driver, vi.Status) {
	if len(ip) == 0 {
		fmt.Println("Error, empty ip address string.")
		os.Exit(0)
	}
	name := fmt.Sprintf("TCPIP::%s::INSTR", ip)
	instr, status := rm.Open(name, mode, timeout)
	if status < vi.SUCCESS {
		fmt.Println("Error, OpenGpib failed with error: ", status)
		os.Exit(0)
	}
	return &Driver{instr}, status
}
func (d *Driver) SetScreenTitle(title string) (status vi.Status) {
	b := fmt.Sprintf("DISP:ANN:TITL:DATA '%s'", title)
	_, status = d.Write([]byte(b), uint32(len(b)))
	return
}
func (d *Driver) SaveScreenShot(name string) (status vi.Status) {
	b := fmt.Sprintf("MMEM:STOR:SCR '%s'", name)
	_, status = d.Write([]byte(b), uint32(len(b)))
	return
}