jdunham Posted December 12, 2008 Report Share Posted December 12, 2008 I thought this would be easy, but so far not. I'd like to test my built application by using VI server to cause a button to be pressed. This web page implies that it should be no problem, as long as you open the Application Reference of the built executable, but it points out that VI server needs to be enabled during the build, which is eminently reasonable. In that web page, it says QUOTE Also, this change still permits you to open application references to an EXE, and subsequent VIs referenced by name, through VI Server when it is enabled for the EXE. with a tantalyzing but unhelpful link on the last bit. So how can I get my built exe to accept VI server connections? I'm using Vista (ick) and LV 8.6. No matter what I put in the INI file, I just get error 63 (server refused connection) when attempting to connect. I haven't even tried worrying about exported VIs, since I can't even connect to the app. I have checked the Windows Firewall, and poked around in the Application Builder options to no avail. Am I missing something? Quote Link to comment
dblk22vball Posted December 12, 2008 Report Share Posted December 12, 2008 Did you enable the TCP/IP in the Vi Server: Configuration options of LabVIEW (Tools>> Options)?? That should then have the TCP/IP enabled in your exe. Also, you might have to add the port as an exception in the windows firewall, although you said you looked at the firewall. Just a thought. Quote Link to comment
Neville D Posted December 12, 2008 Report Share Posted December 12, 2008 QUOTE (jdunham @ Dec 11 2008, 08:14 AM) So how can I get my built exe to accept VI server connections? I'm using Vista (ick) and LV 8.6. No matter what I put in the INI file, I just get error 63 (server refused connection) when attempting to connect. I haven't even tried worrying about exported VIs, since I can't even connect to the app. I have checked the Windows Firewall, and poked around in the Application Builder options to no avail. Am I missing something? Under your Project, right-click on the My Computer and enable VI Server from there. Then try the build. Also, just to trouble-shoot Firewall problems, try to access the exe on your desktop host itself and see if that works. Neville. Quote Link to comment
Dan DeFriese Posted December 12, 2008 Report Share Posted December 12, 2008 Did you set the tcp port in the built exe to serve on a port other than port 3363. This may interfere with Developement Environment. Try adding these keys to your built app's ini file: [Application] server.tcp.paranoid=True server.tcp.servic="My Computer/VI Server" server.tcp.enabled=True server.tcp.access="+localhost" server.tcp.port=3364 Quote Link to comment
Dan DeFriese Posted December 12, 2008 Report Share Posted December 12, 2008 QUOTE (Dan DeFriese @ Dec 11 2008, 12:10 PM) Did you set the tcp port in the built exe to serve on a port other than port 3363. This may interfere with Developement Environment. Try adding these keys to your built app's ini file: [Application] server.tcp.paranoid=True server.tcp.servic="My Computer/VI Server" server.tcp.enabled=True server.tcp.access="+localhost" server.tcp.port=3364 I threw together a simple example (LV 8.5): Unzip Open the Project Build the My Application build spec. Run the application. Open the Driver.vi and Run the Driver.vi Note that the VI Server port is set to 3364 in the application.ini file. Unfortunately, I've never had luck setting this value programmatically at runtime. Hope this helps. Let me know if you have problems. Quote Link to comment
Yair Posted December 12, 2008 Report Share Posted December 12, 2008 The key should indeed be the different port numbers. If you have the same port, then I believe you always get the IDE. Also, if memory serves, you have to wire something into the machine name input, or you always get the current instance. I believe at least that part appears in the documentation. QUOTE (Dan DeFriese @ Dec 11 2008, 09:21 PM) Note that the VI Server port is set to 3364 in the application.ini file. Unfortunately, I've never had luck setting this value programmatically at runtime. That's because enabling the VI server overwrites the value you set with the default port. I reported this to NI a couple of versions back, but I don't know what they did about this. Quote Link to comment
jdunham Posted December 12, 2008 Author Report Share Posted December 12, 2008 QUOTE (dblk22vball @ Dec 11 2008, 08:38 AM) Did you enable the TCP/IP in the Vi Server: Configuration options of LabVIEW (Tools>> Options)??That should then have the TCP/IP enabled in your exe. Also, you might have to add the port as an exception in the windows firewall, although you said you looked at the firewall. Just a thought. I started by copying the relevant options from LabVIEW.ini to my own application's ini. QUOTE (Neville D @ Dec 11 2008, 09:34 AM) Under your Project, right-click on the My Computer and enable VI Server from there. Then try the build. Also, just to trouble-shoot Firewall problems, try to access the exe on your desktop host itself and see if that works. I didn't realize there were target-specific settings, so thanks (though it would be interesting to know whether this does anything more than alter the INI file. I'm trying everything on localhost for now. QUOTE (Dan DeFriese @ Dec 11 2008, 10:10 AM) Did you set the tcp port in the built exe to serve on a port other than port 3363. This may interfere with Developement Environment. No I wasn't trying to use 3363. QUOTE (Dan DeFriese @ Dec 11 2008, 11:21 AM) I threw together a simple example (LV 8.5): I'm going to try this next, thanks a lot! My own simple example is not working. Though I got farther with some of these tips. If the built app is running, then calls to Open App Reference on that port start succeeding, but all of the App Properties like App:Name and App:Kind are referring to the Labview development system rather than the exe. I will try your example and see if the same thing happens. QUOTE (Yair @ Dec 11 2008, 11:41 AM) The key should indeed be the different port numbers. If you have the same port, then I believe you always get the IDE. Also, if memory serves, you have to wire something into the machine name input, or you always get the current instance. I believe at least that part appears in the documentation. That's because enabling the VI server overwrites the value you set with the default port. I reported this to NI a couple of versions back, but I don't know what they did about this. I am using a different port, and always wiring "localhost" as the machine name, but I am still getting the IDE. So the weird thing is that if I ask for some crazy port number, I get error 63, but if I ask for my new application's port number, I get the IDE. I will try some more stuff and then post what I have. Thanks all for the assistance. Well I opened up Dan's lvproj, and then LabVIEW crashed (without any message box, just disappeared from task manager). Then I reloaded everything and both Dan's example and my simpler example (thank you, auto-save) worked as expected. The other difference was that Windows Firewall automatically popped up on launch and asked to unblock the port, and that wasn't happening before. Weird. Then I used SnagIt to capture my diagram, and it also crashed without a trace. I think a reboot is in order. I'll post again if I can reproduce any of that. Thanks again, especially to Dan :beer: for the example! Here's my very simple test http://lavag.org/old_files/monthly_12_2008/post-1764-1229028500.png' target="_blank"> Quote Link to comment
jdunham Posted December 12, 2008 Author Report Share Posted December 12, 2008 So with my LabVIEW restarted and my application having the following settings in its INI file QUOTE server.tcp.enabled=Trueserver.tcp.port=3364 (or whatever you like) It's all working. Other settings might be advisable for slightly better security, but this was enough to make it work. Just like in the development environment, latching booleans won't accept a Value(signalling) property, but I can fix that for the next build. Thanks. Quote Link to comment
kondratko Posted May 1, 2009 Report Share Posted May 1, 2009 QUOTE (jdunham @ Dec 11 2008, 11:40 PM) So with my LabVIEW restarted and my application having the following settings in its INI fileIt's all working. Other settings might be advisable for slightly better security, but this was enough to make it work. Just like in the development environment, latching booleans won't accept a Value(signalling) property, but I can fix that for the next build. Thanks. Have you tried this on the network? I am having very hard time getting this to work in the Run-time environment running on networked computer. Funny thing is everything works under Development System (which I keep on port 3363). The application build is on port 3364, and I cannot for anything get that working. I am getting "Error 66 occurred at Open Application Reference in Remote Run.vi", and have verified that my INI allows access to everything, see below: server.tcp.enabled=True server.tcp.port=3364 server.vi.access="+*" server.tcp.access="+*" server.tcp.paranoid=True If you guys have any points for solution, let me know. BTW, I did just telnet to both of the ports and that does seem to indicate the the VI-server on the Application and Development System are working. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.