From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i pass a vbscript variable to a labview vi?

Hi

As the message subject indicates, how do i pass a vbscript variable to a labview vi?


Thank you.
0 Kudos
Message 1 of 13
(3,326 Views)
My question is what is the relationship between the vbscript and LabVIEW? For example, if the purpose of the VBScript is to setup the parameters and then call the VI, the easiest way is via the LV ActiveX Server. From there you can load and run a VI, passing whatever you want in terms of parameters. See the freqresp.xls in examples/comm for an example on how to do this.

If that isn't what you are looking for, could you give a little more background?
Message 2 of 13
(3,320 Views)
Hi

Just to give you a bit more background. The Vbscript variable is inside a web page and when the script has read in the value for that variable,I want it to pass it to a labview vi.

Thank you.
0 Kudos
Message 3 of 13
(3,308 Views)
Do you mean that it is

1. client side VBScript?
2. server side VBScript in an ASP Page?
3. VB.NET in an ASP.NET page?

Do you already activate the VI from the web page and just want to know how to pass the parameter or do you need to know about running the VI also? If so, do you care about the results of the VI?
0 Kudos
Message 4 of 13
(3,304 Views)
Hi

It is client side Vbscript. Without going into too much detail, the labview application will be on a server and the web page will be on the user's computer.
0 Kudos
Message 5 of 13
(3,302 Views)
Well, this is a bit of a bigger piece of architecture than I was expecting so I am not sure what is available to you to change/implement, but here is what I would do...

Put your vbscript variable into a form input variable. When the user submits the page that variable is transmitted to the server. This is a fairly standard usage for client-side VBScript so that should be straight-forward.

On the server side, you need to pick (or let me know what) server side technology you are using. If you are wide open, I would recommend using ASP.NET, but I am a .NET advocate.

However you decide to process the server request, you are going to take the parameter sent from the client's browser and use the LabVIEW ActiveX Server interface (see User's Manual for more info) to load up and run the VI.

If this sounds like it does the job, let me know and I can answer more specific questions for the various stages. If this doesn't work, I'm going to need a bit more information to help.

BTW - There is a small problem running LV from ASP.NET that requires a bit-o-code to get around in the current release, so if we are going that way, let me know and I'll tell you about it.
0 Kudos
Message 6 of 13
(3,297 Views)
Hi

Thanks for that.

I am trying to pass the filename of a bitmap so it can be set up as a wallpaper on the clients computer. I have got the LV code that does that but i not sure how to interact with the server (ASP or .Net).

I need help.


Thank you.
0 Kudos
Message 7 of 13
(3,293 Views)
nothing to do with vbscript, but you can copy the filename to clipboard and use labview to grab the file name / path.

-Joe
0 Kudos
Message 8 of 13
(3,284 Views)
Question...

1. So the user types in the filename of a bitmap into a browser and hits submit?
2. Where is the bitmap located? (Client or Server)
3. Where is the LV code located? (C or S)

The reason I ask: it sounds like the LV code can set the wallpaper of the computer. But that would only work on the same machine that the LV code is running on. You can't have the server change the client's wallpaper remotely (major security hole if you get it to work). Since IE has the option of setting the client wallpaper, it might be easier to find the API call to do that directly from the client-side VBScript.
0 Kudos
Message 9 of 13
(3,281 Views)
Hi

Thanks for that.

The user selects the bitmap from the labview software (executable) on the client side (from a web page) and hopefully the bitmap is set as a wallpaper on the clients machine.

The labview software is on the server and so is the bitmap.


Thank you
0 Kudos
Message 10 of 13
(3,272 Views)