LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using ASPX page to call ASP.Net Application to start LabVIEW and change a VI

Hi All,

Basically I am a newbie to LabVIEW and am wondering if it is possible to use an ASPX page to call an ASP.NET application that would then start LabVIEW or call a LabVIEW VI template that is on a VI Server, change the VI, take a snap shot of the VI and send that image back to the user in the ASPX page.
0 Kudos
Message 1 of 12
(5,341 Views)
It is possible to have ASP.net start and control LabVIEW by using ActiveX as your medium of communication. If you look you can find many examples of other programs calling LabVIEW through ActiveX.

I have attached an example of ASP opening a VI in LabVIEW. Hope this helps!

Allan
Applications Engineering
National Instruments
0 Kudos
Message 2 of 12
(5,342 Views)
Hi:
 
based on the readme document.
 
1. I placed this zip file contents on to my inetpub\wwwroot\
2. I have LV runtime 6.0 installed on the same machine.
4. I get an

below error

Microsoft VBScript runtime

error '800a01ad'

ActiveX component can't create object: 'LabVIEW.Application'

/LV_ASP/test.asp, line 19

 

am I missing some thing here.

 

Regards

Ram

0 Kudos
Message 3 of 12
(5,224 Views)
The ActiveX Server interface is for the LabVIEW.exe not for the runtime engine. Thus you need to have a full version of LabVIEW installed.
 
If you don't want to do that, you can always build your VI into a DLL and then call the DLL from ASP.NET. There are a couple of issues that you need to be aware of with this, but I've covered them here.
0 Kudos
Message 4 of 12
(5,221 Views)

Brian:

I had the MessagesPump.dll download from one your threads.

The case which I am dealing with is 

1. There is a compiled EXE and a DLL for the same Labview-VI Application.

2. Both of them are installed in a Machine where there is only LV-Runtime installed.

3. THE EXE works fine and I am able to see the application running . ( There is no call to the LABview server and I dont want this) as any stand alone normal windows application.

4. When coming to the DLL+IIS+ASP.NET application. How do I embedded or place or construct the same on a (aspx)Web page and looks exactly the same as in the exe version of it.

5. Manage to get your C# code to VB.NET.

6. Even though there were few explanations on this area from you  this summer , I was not quite clear or to follow  .

Was there any workaround in this area from you on this.

 

Regards

Ram.

 

0 Kudos
Message 5 of 12
(5,207 Views)

Oh, I see the misunderstanding. The EXE you talk about is your LV built application - not related to ASP.NET. Okay...

What you want to look up in your LV docs is "remote front panels". This allows you to either embed a dynamically generated image of the VI into the HTML or actually the front panel itself (requires the RTE on the client machine). The second form means the display is interactive. Unfortunately, the only web server supported for this right now is the LV web server. However, you could do some tricks to get the image (option #1 of RFP) from a LV server and then post it up on the IIS server.

For example, you could create a little LV application that uses the IE control in LV to hit the LV web server, grab the page and then save it in the IIS virtual directory.

You other questions...

5. Manage to get your C# code to VB.NET.

I'm not a VB.NET programmer so I can only tell you what you need to do...The PumpMessages dll is C++ so that isn't going to change. To call it from VB.NET, you need to create a DllImport statement. Trying to convert what is in the MSDN sample, it should be something like

<DllImport("C:\Inetpub\wwwroot\MyWebApp\bin\MyLVApp.dll", EntryPoint := "LVDLLStatus", _
   ExactSpelling := True, _
   CallingConvention := CallingConvention.Cdecl)> _
Public Shared Function MoveFile(errStr As IntPtr, errStrLen As Integer, module As IntPtr) As Integer
    ' Leave function empty -
End Function

The other code just calls it. You need to create a VB.NET class with a static constructor (the static Global() in my example), static member (Thread) and static method (ThreadProc).

6. Even though there were few explanations on this area from you  this summer , I was not quite clear or to follow  .

Was there any workaround in this area from you on this.

I am not sure what you are asking here..I said of lot of stuff over the summer *grin*, just reply with the specific question
0 Kudos
Message 6 of 12
(5,204 Views)

Brian:

Thanks for the first one.( I am trying to figure out the "G web server" option which comes with the internet tool kit).

Let me describe the Application:

Step 1 : I am creating an exe( application) and deploying it on a different machine which the LV run time only.

             The application as an exe run well show the front panel and able to use the UI elements wonderful.

             Note : there is no access to the Labview server (VI) at all.

Step 2: Secondly, thinking that this VI compiled as an exe can run on a machine without the Labview server I am taking it one step further to compile it as a dll. ( there are different options but let say shared dll)

Step 3: I have an ASP.NET application ( this is exactly the same you have explained in your Blog site). and  now I will have to deploy my VI compiled as a DLL and called from an ASPX page in an aspx application which should now show the same Front pannel as it did with the standalone exe application.

Step 4: I see your MessagePump.dll governs the messaging or call between the LV and the Windows to override the threading,

   when each call from the LV dll instead of directly call the windows base class methods. I saw your explanation in a thread and that was my question and was not able to follow that but was pretty close.( i.e running a test.aspx and showing the results in results.aspx). 

Step 5: In short :

             I have a machine  (Say Windows 2003 server with IIS and with dotnet confiured).

             Installed the LV Run time 6.0.

             Have the VI compiled as DLL also your MessagePump.dll

             There is no communication between the Labview VI server.

        

 

            

 

 

 

 

 

 

 

 

0 Kudos
Message 7 of 12
(5,200 Views)

Brian:

Thanks for the first one.( I am trying to figure out the "G web server" option which comes with the internet tool kit).

Let me describe the Application:

Step 1 : I am creating an exe( application) and deploying it on a different machine which the LV run time only.

             The application as an exe run well show the front panel and able to use the UI elements wonderful.

             Note : there is no access to the Labview server (VI) at all.

Step 2: Secondly, thinking that this VI compiled as an exe can run on a machine without the Labview server I am taking it one step further to compile it as a dll. ( there are different options but let say shared dll)

Step 3: I have an ASP.NET application ( this is exactly the same you have explained in your Blog site). and  now I will have to deploy my VI compiled as a DLL and called from an ASPX page in an aspx application which should now show the same Front pannel as it did with the standalone exe application.

Step 4: I see your MessagePump.dll governs the messaging or call between the LV and the Windows to override the threading,

   when each call from the LV dll instead of directly call the windows base class methods. I saw your explanation in a thread and that was my question and was not able to follow that but was pretty close.( i.e running a test.aspx and showing the results in results.aspx). 

Step 5: In short :

             I have a machine  (Say Windows 2003 server with IIS and with dotnet confiured).

             Installed the LV Run time 6.0.

             Have the VI compiled as DLL also your MessagePump.dll

             There is no communication between the Labview VI server.

         

 

            

 

 

 

 

 

 

 

 

0 Kudos
Message 8 of 12
(5,200 Views)

Brian:

Thanks for the first one.( I am trying to figure out the "G web server" option which comes with the internet tool kit).

Let me describe the Application:

Step 1 : I am creating an exe( application) and deploying it on a different machine which the LV run time only.

             The application as an exe run well show the front panel and able to use the UI elements wonderful.

             Note : there is no access to the Labview server (VI) at all.

Step 2: Secondly, thinking that this VI compiled as an exe can run on a machine without the Labview server I am taking it one step further to compile it as a dll. ( there are different options but let say shared dll)

Step 3: I have an ASP.NET application ( this is exactly the same you have explained in your Blog site). and  now I will have to deploy my VI compiled as a DLL and called from an ASPX page in an aspx application which should now show the same Front pannel as it did with the standalone exe application.

Step 4: I see your MessagePump.dll governs the messaging or call between the LV and the Windows to override the threading,

   when each call from the LV dll instead of directly call the windows base class methods. I saw your explanation in a thread and that was my question and was not able to follow that but was pretty close.( i.e running a test.aspx and showing the results in results.aspx). 

Step 5: In short :

             I have a machine  (Say Windows 2003 server with IIS and with dotnet confiured).

             Installed the LV Run time 6.0.

             Have the VI compiled as DLL also your MessagePump.dll

             There is no communication between the Labview VI server.

          

 

            

 

 

 

 

 

 

 

 

0 Kudos
Message 9 of 12
(5,200 Views)

Brian:

Thanks for the first one.( I am trying to figure out the "G web server" option which comes with the internet tool kit).

Let me describe the Application:

Step 1 : I am creating an exe( application) and deploying it on a different machine which the LV run time only.

             The application as an exe run well show the front panel and able to use the UI elements wonderful.

             Note : there is no access to the Labview server (VI) at all.

Step 2: Secondly, thinking that this VI compiled as an exe can run on a machine without the Labview server I am taking it one step further to compile it as a dll. ( there are different options but let say shared dll)

Step 3: I have an ASP.NET application ( this is exactly the same you have explained in your Blog site). and  now I will have to deploy my VI compiled as a DLL and called from an ASPX page in an aspx application which should now show the same Front pannel as it did with the standalone exe application.

Step 4: I see your MessagePump.dll governs the messaging or call between the LV and the Windows to override the threading,

   when each call from the LV dll instead of directly call the windows base class methods. I saw your explanation in a thread and that was my question and was not able to follow that but was pretty close.( i.e running a test.aspx and showing the results in results.aspx). 

Step 5: In short :

             I have a machine  (Say Windows 2003 server with IIS and with dotnet confiured).

             Installed the LV Run time 6.0.

             Have the VI compiled as DLL also your MessagePump.dll

             There is no communication between the Labview VI server.

           

 

            

 

 

 

 

 

 

 

 

0 Kudos
Message 10 of 12
(5,201 Views)