Hi Beamer,
A couple of questions on this. First, what version of visual basic?
You could use code smilar to this:
Sub ibrda(ByVal ud As Integer, buf As String)
Dim cnt As Long
' Check to see if GPIB Global variables are registered
If (GPIBglobalsRegistered = 0) Then
Call RegisterGPIBGlobals
End If
cnt = CLng(Len(buf))
Call ibrda32(ud, ByVal buf, cnt)
Call copy_ibvars
End Sub
However there may be some issues with this. With older versions of Visual basic, there was a buffer remaping issue that would make all ibrda calls work likd ibrd calls.
I was unable to determine if this issue has been resolved in VB 6.0 however I can offer a possible workaround if you determine that the same thing is occurring.
One possible workaround is t
o use direct Win32 API functions to lock the buffers being used by these calls. GlobalLock is one function that allows a user to lock the buffer. You might be able to lock the buffer before making a call to ibrda so that Visual Basic cannot change it. Then when the ibrda call completes (that is, ibsta returns a status of CMPL, or ibstop is called, or some error occurs), you can unlock the buffer.
This is quite in depth, and you may want to try spawning threads in VB. To look into this more check out
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconapartmentmodelmultithreadinginvisualbasic.asp
Hope this helps out Beamer,
Aaron K.
Application Engineer
National Instruments