Environment.NewLine
constant instead.
07-17-2007 08:43 PM
07-17-2007 11:58 PM
As far as I can see this actually is VB code! I have very little experience on Agilent instruments, but I have found this document that I hope will help you to integrate this code in VB
07-23-2007 02:58 AM
11-25-2024 12:00 PM
Hello. Sorry for resurrecting a very old topic and using a very old programming language . I just happen to be having the similar problem.
I'm trying to retrieve a screenshot from an oscilloscope with the ReadIEEEBLOCK command. However, seems whenever I reach the command line to ReadIEEEBLOCK I will encounter an IO error. Another observation is that this causes the scope to be unresponsive to queries and will respond again by removing and reconnecting the USB port.
The oscilloscope is a UNI-T UTD2102CEX+. Not sure for now what could be causing the problem.
Here is a screenshot from the programming manual that I refer to.
Here is the code
Module Module1
Dim OSCOPE As VisaComLib.FormattedIO488
Sub SetIO(ByRef ioAddress As String)
Dim MGR As VisaComLib.ResourceManager
Dim BYTEDATA() As byte
Dim OSCOPESTATUS As
String
ioAddress = "USB::0x5656::0x0832::ADO2723060520::INSTR"
MGR = New VisaComLib.ResourceManager
OSCOPE = New VisaComLib.FormattedIO488
OSCOPE.IO = MGR.Open(ioAddress)
With OSCOPE
.IO.Timeout = 4000
.IO.TerminationCharacterEnabled = False
.IO.SendEndEnabled = True
.WriteString(":DISPlay:DATA? ")
BYTEDATA = .ReadIEEEBlock(VisaComLib.IEEEBinaryType.BinaryType_UI1)
End With
Exit Sub
End Sub
End Module
12-03-2024 02:27 AM
First, you posted in the LabWindows/CVI forum but your question is really Visual Basic related. Not only is it the wrong forum but LabWindows/CVI is a C programming environment and therefore many CVI users might not have or want to deal with Visual Basic. Furthermore, LabWindows/CVI has been pretty much sunset by NI, so this forum is fairly inactive (Not that the Measurement Studio forum is in a better shape, NI has sunset that even earlier than LabWindows/CVI).
Looking at your code I see two things that look suspicious and might be the reason for your device not wanting to respond:
.WriteString(":DISPlay:DATA? ")
There is a space character at the end after the question mark, some devices would ignore that, others will simply hiccup on it.
Furthermore you are using a USB T&M Class device VISA resource, does your device really support that? The manual seems silent about that but it clearly states:
The command string must end with a newline <NL> character.
Visual Basic 6 used the special nominators: vbCrLf, vbCr, vbLf that you could concatenate to your string.
.WriteString(":DISPlay:DATA?" & vbLf)
Visual Basic .Net has depreciated them but kept them for backwards compatibility reason but provides the new
Environment.NewLine
constant instead.