4. Programming Interfaces
Giga-tronics 2400/2500 Microwave Synthesizer Series
16
Programming Manual, Part Number 34783, Rev A, July 2009
4.3.2.5 Programming Example: List Operation Using Visual Basic
Step
Description
1.
Perform step 1 through step 3 of Table 7 on page 10 to create a Visual Basic project.
2.
Write following:
‘This routine can load any list file to 2400/2500 synthesizer
‘and set up repeat type and trigger type.
Dim status As Long
Dim listFileName As String
Dim statusText As String
Dim instrumentHandle As Long
statusText = Space(100)
status = GT2400_OpenConnection(0, 6, 0, instrumentHandle)
If status < SUCCESS Then
GT2400_GetErrorMessage(status, statusText)
MsgBox statusText
End If
‘Please replace C:\Temp\ListTest.txt with your list file name.
listFileName = “C:\Temp\ListTest.txt”
status = GT2400_LoadListFromFile(listFileName, listFileName)
If status < SUCCESS Then
‘Error during loading
GT2400_GetErrorMessage(status, statusText)
MsgBox statusText
End If
status = GT2400_DownloadList(instrumentHandle, listFileName)
‘Repeat Type (0 = single step; 1 = single sweep; 2 = continuous) =")
status = GT2400_SetRepeatType(instrumentHandle, 1)
‘ Trigger Type (0 = External trigger; 1 = Software trigger or GET) =")
status = GT2400_SetTriggerType(instrumentHandle, 0)
status = GT2400_SetRF(instrumentHandle, 1)
status = GT2400_CloseAllConnections()
3.
Build the project.
4.
Run the program.
5.
Send trigger.
End of example