402 Keysight InfiniiVision DSOX1204A/G Oscilloscopes Programmer's Guide21 :MTESt CommandsPrivate Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Sub Main()On Error GoTo VisaComError' Create the VISA COM I/O resource.Set myMgr = New VisaComLib.ResourceManagerSet myScope = New VisaComLib.FormattedIO488Set myScope.IO = _myMgr.Open("USB0::0x0957::0x17A6::US50210029::0::INSTR")myScope.IO.Clear ' Clear the interface.' Make sure oscilloscope is running.myScope.WriteString ":RUN"' Set mask test termination conditions.myScope.WriteString ":MTESt:RMODe SIGMa"myScope.WriteString ":MTESt:RMODe?"strQueryResult = myScope.ReadStringDebug.Print "Mask test termination mode: " + strQueryResultmyScope.WriteString ":MTESt:RMODe:SIGMa 4.2"myScope.WriteString ":MTESt:RMODe:SIGMa?"varQueryResult = myScope.ReadNumberDebug.Print "Mask test termination 'test sigma': " + _FormatNumber(varQueryResult)' Use auto-mask to create mask.myScope.WriteString ":MTESt:AMASk:SOURce CHANnel1"myScope.WriteString ":MTESt:AMASk:SOURce?"strQueryResult = myScope.ReadStringDebug.Print "Mask test auto-mask source: " + strQueryResultmyScope.WriteString ":MTESt:AMASk:UNITs DIVisions"myScope.WriteString ":MTESt:AMASk:UNITs?"strQueryResult = myScope.ReadStringDebug.Print "Mask test auto-mask units: " + strQueryResultmyScope.WriteString ":MTESt:AMASk:XDELta 0.1"myScope.WriteString ":MTESt:AMASk:XDELta?"varQueryResult = myScope.ReadNumberDebug.Print "Mask test auto-mask X delta: " + _FormatNumber(varQueryResult)myScope.WriteString ":MTESt:AMASk:YDELta 0.1"myScope.WriteString ":MTESt:AMASk:YDELta?"varQueryResult = myScope.ReadNumberDebug.Print "Mask test auto-mask Y delta: " + _FormatNumber(varQueryResult)' Enable "Auto Mask Created" event (bit 10, &H400)myScope.WriteString "*CLS"myScope.WriteString ":MTEenable " + CStr(CInt("&H400"))' Create mask.