Programming Examples
40
Keysight InfiniiVision M9241/42/43A PXIe Oscilloscopes SCPI Programmer's Guide
1473
}
if (strcmp(str_out, "") != 0)
{
printf("INST Error%s\n", str_out);
iflush(id, I_BUF_READ | I_BUF_WRITE);
}
}
SICL Example in Visual Basic
To run this example in Visual Basic for Applications:
1
Start the application that provides Visual Basic for Applications (for example,
Microsoft Excel).
2
Press ALT+F11 to launch the Visual Basic editor.
3
Add the sicl32.bas file to your project:
a
Choose
File > Import File...
.
b
Navigate to the header file, sicl32.bas (installed with Keysight IO Libraries
Suite and found in the Program Files\Agilent\IO Libraries Suite\include
directory), select it, and click
Open
.
4
Choose
Insert > Module
.
5
Cut-and-paste the code that follows into the editor.
6
Edit the program to use the SICL address of your oscilloscope, and save the
changes.
7
Run the program.
'
' Keysight SICL Example in Visual Basic
' -------------------------------------------------------------------
' This program illustrates a few commonly-used programming
' features of your Keysight oscilloscope.
' -------------------------------------------------------------------
Option Explicit
Public id As Integer
' Session to instrument.
' Declare variables to hold numeric values returned by
' ivscanf/ifread.
Public dblQueryResult As Double
Public Const ByteArraySize = 5000000
Public retCount As Long
Public byteArray(ByteArraySize) As Byte
' Declare fixed length string variable to hold string value returned
' by ivscanf.
Public strQueryResult As String * 200
' For Sleep subroutine.