LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

webserver in seperate exe file??

Hi Guys

 

So - I'm developing a piece of software that aqquires data from a USB board - this has been working well for years, everybody is happy..

Now I want to publish the results to users via the NI web server.. Using the web publishing tool I have created a html doc from a sub VI within  the main application with the front panel I wish to publish, and that displays various values updated every 5 seconds..(the monitor function, NOT remote control).. I quickly realized that when a number of browsers are looking at the VI my main application starts to hang - have not been able to fully understand why, but I guess the NI core waits for each request to be shipped.. not really a problem since I'm not doing a VI to be published on facebook with +1.000.000 viewers - but since it potentially stalls the entire application, I risk that my measurement is disrupted, which is a no go, since the measurement may be in the field somewhere, and not next to a guy at an office desk.. Thus - I moved the call to the sub-VI into an external call using a static VI reference and the front panel open / Run methods and the "wait untill Done" flag set to false.

This too is working very well and inside the development system I can now "sabotage" the application with multiple hits on the "refresh" button of a browser without stalling the application.. now problems arise - part because I do not have a full working knowledge of how the runtime engine operates, i guess - but... when I build this program into an exe, I can again stall the program by hitting the "refresh" button fast.... I assume that the runtime engine treats everything called from within the exe file in one thread?? 

 

Questions:

Is there a way (in a labVIEW .EXE file) to call a VI from another VI that totally separates them from each other so that if 'mainprogram' calls 'webserver', and 'webserver' hangs for some reason, this does not cause 'mainprogram' to equally hang? Could I for instance change the execution system of the VI with all 'webserver' related contant in the "execution" options?

 

If not - I guess building two exe files 'mainprogram' & 'webserver' and then launch 'webserver' using system exec from 'mainprogram' will prove a solution.

however - this means that now passing of data is no longer possible - in 2010 using lv8.6, what is the best means to move data back and forth between two seperate exe files? Ideally I would send a cluster of refnum's of the indicators from 'mainprogram' then read the values of these in 'webserver' and update the display here - but is the reference addresses from one exe, anything worth in the other exe (two seperate address spaces etc)?

Should I learn to use datasockets - or would a TCP approach be the best? We are not talking massive amounts of data - in the area of 15 value and string controls + 2 graphs with less than 1000 points. Remember that this should only be done locally between two exe files on the same computer, to I would prefer to keep this as simple as possible - something like a pipe used in Unix code. 

 

Last but not least - is there a way to run 'webserver' as some sort of service, so that the user will avoid having a window open he does not need, or a minimized 'webserver' window in the taskbar?

 

many questions - and yes I know that I can read all about datasockets and TCP in the forum halls - and I'm doing it, but I would prefer to not waste too many days brushing up on new stuff not needed because my plan is wack from the start..

 

Thank you for your help. 

 

0 Kudos
Message 1 of 1
(2,343 Views)