LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ReadIEEEBLOCK

Can anyone tell me this function call "ReadIEEEBLOCK" at the link below
 
 
 
is a function call from NI 488.2 or NI VISA oe ANSI C function call?? IF i want to conduct the same fucntion call in VB, which function call in VB should i use??
 
I am sorry that it is little bit relating to NI, but please help....
 
Thanks..
0 Kudos
Message 1 of 5
(5,693 Views)

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



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 5
(5,688 Views)
ReadIEEEBlock/WriteIEEEBlock are COM (Microsoft, Component Object Model) methods provided by IFormattedIO488 VISA COM interface.  The COM interface is common for all the VISA COM software from any vendor and not vendor-specific.  However it can only be used through the VISA COM API, and not through the legacy VISA-C (visa32.dll).  VISA COM is easier than VISA-C for most VB users.
0 Kudos
Message 3 of 5
(5,656 Views)

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.

johnjavs_0-1732556900171.png

 

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

 

0 Kudos
Message 4 of 5
(87 Views)

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.NewLineconstant instead.

 

Rolf Kalbermatter
My Blog
Message 5 of 5
(42 Views)