LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass value from HTML Radio button to VI?

Hi, Everyone!

 

I want to create web service project but I'm laging of knowledge.

In my project I have ring constant on the front panel that have 6 items and control the case structure.

And I want to use HTML that have radio buttons to pass value to control this ring constant.

 

  - Is it possible?

  - If it possible, Did someone have some examples?

  - I found example that use JS to communicate with VI. In my case, Is it necessary?

 

Thanks!

0 Kudos
Message 1 of 5
(1,542 Views)

Hi Vindecua!

Great question. Based on your description, I believe this should be possible. I wanted to provide you with some documentation to get you started.

This document was originally written for an older version of LabVIEW, but I use 2016 and these functions are still present, so I anticipate this is still valid.

 

"Reading HTML Code From a Web Site in LabVIEW"

http://digital.ni.com/public.nsf/allkb/89171CEC879A70A3862572950057ACC6

"Ring Constant"

https://zone.ni.com/reference/en-XX/help/371361J-01/glang/ring_constant/

"Creating a Radio Buttons Control"

https://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/create_radio_buttons_ctrl/

 

The LabVIEW example finder (Help --> Find Examples) is a good place to start if you want some base examples for these functions; if I knew some more specifics about your code, I could point you more specific examples. Hope this helps to get you started! 

 

Thanks!

Erika
Technical Support Engineer
National Instruments
Message 2 of 5
(1,477 Views)

Here is a good example for you to look at: http://forums.ni.com/t5/LabVIEW-Web-Development/Getting-Started-Series-Simple-JavaScript-and-HTML-wi.... I think, yes, you do need to use Javascript to control the sending of get requests to the webservice so that LabVIEW can get the data. In your case you could follow similar to the example, but use your radio buttons in place of the number inputs in the HTML and change the URL for the get request accordingly.

 

I think an easier way to do it is to use Angular with Javascript. I posted an example with this a while ago: http://forums.ni.com/t5/LabVIEW-Web-Development/LabVIEW-WebService-With-AngularJS/m-p/3466786

Message 3 of 5
(1,473 Views)

Hi, Everyone.

Thanks for your reply!

 

Now, I have change something about my project.

I'm not use ring constant anymore and changed it to the string Indicators.

I want to use HTML radio buttons to select choices and push submit button to pass values that I declare on the radio buttons to the case structure in VI.

But I'm not understand how to get values and still don't understand JS and HTML. 😞

Has anyone have any ideas? 

 

Thanks!

Download All
0 Kudos
Message 4 of 5
(1,448 Views)

If you have a webpage that you want to communicate with a webserver, then I think you need to learn to understand at least basic JS and HTML. Are you looking for guidance on resources for learning about it? I would recommend looking over those two examples in detail. Go through them and make sure you understand every part. If you don't understand some part, first google it, and if you still don't understand then post your specific question here. Once you understand those basics, then we can help you if you run into problems adapting that to your application with radio buttons and strings. It's a lot easier to be helpful on the forum if we have a specific question to help you with.

Message 5 of 5
(1,427 Views)