LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to connect to an IP adress through a browser opened with Labview

Solved!
Go to solution

Hi all

I'm trying to create a VI where you have a web page opened inside a Lab view program. This web page should only be connected to a certain IP address corresponding to an electric meter. I have tried putting the IP address inside the URL, but each time I try to, I am either unable to connect or I get this error :

 

Erreur_Browser.png

 A translation gives : "An erreur has occurred in the script on this page", the Error being : "String, number, identifier expected". It then asks if if I still want to execute the scripts on this page. If I say yes, the page is then stuck with a black screen, and loading is written in white in the middle.

 

Both Edge and Firefox (the two browsers installed on the computer) correctly link to the IP address without any issues. I tried changing "/" to "%2F", its UTF-8 equivalent but it didn't change anything. Here is a copy of the program :

  Browser_VI.png

 If anyone has any idea of how to solve this, I'd be grateful.

0 Kudos
Message 1 of 8
(3,414 Views)

please try to open the URL with Internet Explorer (WIN+R  and enter "iexplore" without the ")

i assume that the library you are using (possibly this one https://forums.ni.com/t5/Example-Programs/Simple-LabVIEW-Web-Browser/ta-p/3501835) is utilizing the internet explorer via activex.

it might be, that internet explorer has problems with whatever script is embedded in the website.

 

EDIT: or it is an activex problem

unfortunately i suppose, this would be problematic to troubleshoot without having your device at hand.


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 2 of 8
(3,392 Views)

Unfortunately I don't have access to the program right now, so I won't be able to check if either activex or internet explorer had problems until tomorrow morning gmt +2.

I am working on two simultaneous computers, one of which is on Windows 7 and the other on Windows 10, yet neither worked. I also switched the default browser to Firefox for the one on Windows 10, but that didn't do anything. So it might be an activex problem, I'll check tomorrow which version is installed on the computers.

0 Kudos
Message 3 of 8
(3,384 Views)
Solution
Accepted by topic author NL5000

switching the default browser does nothing for this problem.

activex will only work/use internet explorer (i'm pretty sure).

 

just test and come back ..

that's the great stuff about this community, there are all timezones present 😉

 

and since you are new, i recommend skimming to this nice writeup of hoovaah

https://forums.ni.com/t5/Community-Documents/Unofficial-Forum-Rules-and-Guidelines/ta-p/3536495

 

regards

 

EDIT:

from your first post it is not clear whether you have tried any other urls from your VI.

that would at least rule out the activex part, i suppose.

 


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 4 of 8
(3,376 Views)

Right sorry, I definitely should have read the forum guidelines before posting. I'll post the code tomorrow though like you said it's pretty standard.

 

Yeah I tested several other URLs and they all worked perfectly, hence why I'm a bit perplexed as to why it doesn't work with the IP address. I should also point out that while I was able to navigate on web pages, I did get similar errors when clicking on specific pages, I'll try to reproduce them tomorrow and post the images here.

0 Kudos
Message 5 of 8
(3,367 Views)

Alright so turns out you were right : I should have tried using IE and not Edge and Firefox in order to access to the IP address. If I had, I would have realized that I was stuck on the same loading screen as inside Labview, though without the script messages : for some sort of reason they only appear within the Labview interface and not on IE, despite the fact that I disabled them on IE ( maybe that ought to be looked at by someone inside NI Instruments?). In any case I had someone come by from the Informatic service, and he was unable to fix the problem. It seems that the eco meter (electric meter) just doesn't work with IE, so I'm going to call the company responsible for the product and see if they can help me. Otherwise I guess I would need to install Activex for Firefox or Edge, something I'm not too keen on in since from what I understand it's not something that's really recommended. And in the worse case scenario, I'll just make the window pop-up on it's own : less visually interesting but it would still work. Thanks for the help, I'll try to keep you updated.

0 Kudos
Message 6 of 8
(3,349 Views)

The company does not indeed support IE, and doesn't seem to plan to, so I'm going to go for the third option I cited above. Since I haven't heard from you, I'm going to mark your last answer as the response to my question, in order to close this thread ( or at least bring about some form of closure).

0 Kudos
Message 7 of 8
(3,324 Views)

Just an assumption but fairly informed: The reason that disabling the dialog in IE won't have any effect in LabVIEW is most likely due to the fact that the UI component of IE that you see when starting up IE is really a rather thin shim layer around the actual IE engine which is more or less what you access from the LabVIEW ActiveX interface. This engine will always throw an according exception when running into this or other errors. The option in the IE application only has effect for this small shim layer that simply catches and then throws away these exceptions rather than displaying it.

 

There is a chance that by digging deep into the IE object hierarchy in the ActiveX interface you can actually disable that option too, by setting some property of the IE ActiveX object or some of its sub objects, but I would guess that the desire to do so is for most people far below 0 considering the state of IE as a feasible webbrowser nowadays.

 

Now integrating another browser engine is an exercise of its own. Most do not support ActiveX anymore as Microsoft is trying to move everyone to .Net instead. One possible candidate might be CefSharp, which is built on Google Chromium.  But I never tried to use the .Net front panel container, so not sure how well this exercise would fare. Here is a CodeProject article about integrating it into a Visual Studio .Net application, but I'm sure it could be used to get at least some ideas about setting up the binary files in such a way that they can be also used from a LabVIEW project.

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 8
(3,313 Views)