Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

I am trying to develop a web enabled app(ASP) using VB.Net.I am using the visa driver class provided by"Saikey",I am getting an error Unable to load DLL(Visa32.Dll).Would appreciate any help on this problem

Has anyone developed a web enabled App using VB.net(visa driver).I have tried to develop this using tha ASP.net project type.When i try running the App it gives me an error message"Unable to load DLL(visa32.dll).The visa32.dll is in the proper directory for my project.Any help would be appreciated.
0 Kudos
Message 1 of 6
(4,287 Views)
Obviously, I don't know how your app is structured. But I will make some guesses and try to help.

If you just want your measurement results to be available over the web, then I would write all your data to a database server and have a webpage that can acess that data. That's just my opinion and is what I do.

If your trying to make a webpage that you can access from your test station and run your test from that, then you must make sure that the actual test code runs client side. Based on the error you mention I would guess that your test code is running on a machine that does not have VISA installed on it.
So make the test code a component that the client machine has to download and run kind of like java code (note: not JScript or ECMA script, but ac
tual java.)
0 Kudos
Message 2 of 6
(4,287 Views)
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
0 Kudos
Message 3 of 6
(4,286 Views)
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
0 Kudos
Message 4 of 6
(4,286 Views)
unless the server is the test station with the GPIB card in it, then having this code run server side will not work. Basically the code has to run wherever the GPIB card is installed.

I seem to remember that there is some way to send VISA commands over a TCP/IP link to a (for lack of a better word) slave computer. But I never used it much. It might have actually been an HP SICL feature. Perhaps a Ethernet to GPIB converter would do what you want. Then the server could address the equipment directly.
0 Kudos
Message 5 of 6
(4,287 Views)
Hello Saikey:I have tried transcibing your C# project,which you posted on 5/1/2002 into a C# ASP.Net Web Application.I duplicated all of your controls on the asp webform and included your classes in the project,It still can't seem to load the visa32.dll.If you ever get some free time perhaps you could try porting your app to an ASP project.Thanks for all of your help with my questions
0 Kudos
Message 6 of 6
(4,287 Views)