EasyManua.ls Logo

Agilent Technologies E5071C - Page 1028

Agilent Technologies E5071C
2685 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Programming
1255
Saving Files
• Overview
• Sample Program in Excel VBA
• Sample Program in HT Basic
Other topics about Sample Programs
Overview
The sample program demonstrates how to save a file. This program saves
selected content on a file with a specified name.
See Saving and Recalling File for this programming.
Sample Program in Excel VBA
Sub File_Save()
' Declare two string variables for file name and file type
Dim File_Name As String
Dim File_Type As String
Dim defrm As Long
Dim vi As Long
Const TimeOutTime = 10000
' Check whether file name textbox is empty or not
If TextBox1.Text <> "" Then
File_Name = Trim(TextBox1.Text)
File_Type = Trim(frmFileSave.ComboBox1.Value)
' Open connection to the E5071C
Call viOpenDefaultRM(defrm)
Call viOpen(defrm, "GPIB0::18::INSTR", 0, 0, vi)
Call viSetAttribute(vi, VI_ATTR_TMO_VALUE, TimeOutTime)
Select Case File_Type
Case "1: State (State only)"
Call viVPrintf(vi, ":MMEM:STOR:STYP STAT" + vbLf, 0)
Call viVPrintf(vi, ":MMEM:STOR """ & File_Name & ".sta""" + vbLf, 0)
Case "2: State (State & Cal)"
Call viVPrintf(vi, ":MMEM:STOR:STYP CST" + vbLf, 0)
Call viVPrintf(vi, ":MMEM:STOR """ & File_Name & ".sta""" + vbLf, 0)
Case "3: State (State & Trace)"
Call viVPrintf(vi, ":MMEM:STOR:STYP DST" + vbLf, 0)
Call viVPrintf(vi, ":MMEM:STOR """ & File_Name & ".sta""" + vbLf, 0)
Case "4: State (State & Cal & Trace)"

Table of Contents