Hi:Thanks for your response.The following code works fine in a standard VB.Net windows Application,It is just a send and receive instruction to a power meter over the GPIB bus.This code is behind a Button,and a label displays the result.I have a problem when I try to duplicate this simple code on an ASP.Net page using Server controls.When you click the button the code is supposed to execute on the server side and not the client side(browser).The code fails when it gets to the viOpenDefaultRM line,I get an error message as follows System.DllNotFoundException:Unable to Load Dll(VISA32.DLL).I have added a reference to the visa library from within the project.
'''''This is the code I am using'''''
Dim lsnbuf As String = Space(100)
Dim wq As Long
Dim drm As Long
Dim ret As Long
Dim vi As Long
Dim tlkbuf As String
Dim FoundCRLF As String
Dim CleanString As String
Dim rcnt As Long
wq = viOpenDefaultRM(drm) 'Open Vi session
wq = viOpen(drm, "GPIB0::2::INSTR", VI_NULL, 5000, vi)
tlkbuf = "*IDN?"
ret = viWrite(vi, tlkbuf, Len(tlkbuf), rcnt)
ret = viRead(vi, lsnbuf, 100, rcnt)
FoundCRLF = InStr(lsnbuf, vbCrLf)
If FoundCRLF > 0 Then
CleanString = Mid(lsnbuf, 1, FoundCRLF - 1)
End If
Label1.Text = CleanString 'display IDN String